本文整理汇总了C#中Cell.Open方法的典型用法代码示例。如果您正苦于以下问题:C# Cell.Open方法的具体用法?C# Cell.Open怎么用?C# Cell.Open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cell
的用法示例。
在下文中一共展示了Cell.Open方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldBeOpenedOnceOpened
public void ShouldBeOpenedOnceOpened()
{
var cell = new Cell(new CellContents(false), new Position(0, 0));
Assert.IsFalse(cell.IsOpen);
cell.Open();
Assert.IsTrue(cell.IsOpen);
}
示例2: ShouldCountTheBombsAround
public void ShouldCountTheBombsAround()
{
var board = new Board(2);
board.AddBombAt(1, 1);
var result = board.Open(1, 0);
var cell = new Cell(new CellContents(false), new Position(1, 0));
cell.Open();
var expectedResult = new CellState(cell, 1);
Assert.AreEqual(expectedResult, result);
}
示例3: ShouldProvideAMechanismToOpenItself
public void ShouldProvideAMechanismToOpenItself()
{
var cell1 = new Cell(new CellContents(false), new Position(0, 0));
var expectedContents1 = new CellContents(false);
Assert.AreEqual(expectedContents1, cell1.Open());
var cell2 = new Cell(new CellContents(true), new Position(0, 0));
var expectedContents2 = new CellContents(true);
Assert.AreEqual(expectedContents2, cell2.Open());
}
示例4: ShouldProvideAMechanismToOpenACell
public void ShouldProvideAMechanismToOpenACell()
{
var board = new Board(2);
var result = board.Open(1, 1);
var cell = new Cell(new CellContents(false), new Position(1, 1));
cell.Open();
var expectedResult = new CellState(cell, 0);
Assert.AreEqual(expectedResult, result);
}