public void TestFlagVisitorIsChangingState() { Cell cell = new MineCell(new Position(1, 1)); IVisitor visitor = new FlagVisitor(); visitor.Visit(cell); Assert.AreEqual(cell.Type, CellTypes.Flag); }
public void TestCellRevealingVisitorIsChangingState() { Cell cell = new MineCell(new Position(1, 1)); IVisitor visitor = new CellRevealingVisitor(); cell.Accept(visitor); Assert.AreEqual(true, cell.IsCellRevealed); }
public void TestFlagVisitorIsKeepingStateWhenCellIsRevealled() { Cell cell = new MineCell(new Position(1, 1)); IVisitor visitor = new FlagVisitor(); cell.IsCellRevealed = true; cell.Accept(visitor); Assert.AreNotEqual(cell.Type, CellTypes.Safe); }
public void TestMineCellVisitor() { var visitorMock = new Mock<IVisitor>(); visitorMock.Setup(v => v.Visit(It.IsAny<Cell>())).Verifiable(); MineCell cell = new MineCell(new Position(1, 1)); cell.Accept(visitorMock.Object); visitorMock.Verify(); }
public void TestMineCellType() { Cell cell = new MineCell(new Position(1, 1)); Assert.AreEqual(CellTypes.Mine, cell.Type); }
public void TestCellRevealMethod() { Cell cell = new MineCell(new Position(1, 1)); cell.RevealCell(); Assert.AreEqual(true, cell.IsCellRevealed); }
public void TestCellPositionCoordinates() { Cell cell = new MineCell(new Position(5, 5)); Assert.AreEqual(new Position(5, 5), cell.Coordinates); }
public void TestCellConstructorWithNegativeRowValue() { Cell cell = new MineCell(new Position(-1, 5)); }
public void TestCellConstructorWithNegativeColValue() { Cell cell = new MineCell(new Position(1, -5)); }