public void CanAdvanceFalse() { var field = new Field( 10, 10 ); var checker = new Mock<OverlapChecker>(); checker.Setup( x => x.Check( field, null, 0, 1 ) ).Returns( false ); field.Checker = checker.Object; Assert.AreEqual( false, field.CanAdvance() ); }
public void Test_CanAdvance_WhenNotAtTheBottom_ReturnsTrue() { int blockHeight = 3; int fieldHeight = 10; Field subject = new Field(10, 10); subject.SetBlock(new BlockHelper.MockBlock(1, blockHeight), new Vector2(2, fieldHeight - blockHeight - 1)); Assert.That(subject.CanAdvance(), Is.True); }
public void Test_CanAdvance_WhenAtBottom_ReturnsFalse() { int blockHeight = 3; int fieldHeight = 10; Field subject = new Field(10, 10); subject.SetBlock(new BlockHelper.MockBlock(1, blockHeight), new Vector2(3, fieldHeight - blockHeight)); Assert.That(subject.CanAdvance(), Is.False); }
public void Test_CanAdvance_WhenNotAtTheBottom_ReturnsTrue() { int blockHeight = 3; int fieldHeight = 10; Mock<IBlock> block = new Mock<IBlock>(); block.Setup(b => b.Height).Returns(blockHeight); Field subject = new Field(10, 10); subject.SetBlock(block.Object, new Vector2(2, fieldHeight - blockHeight - 1)); Assert.IsTrue(subject.CanAdvance()); }
public void Test_CanAdvance_WhenNotAtTheBottomButBlockInWay_ReturnsFalse() { int blockHeight = 3; int fieldHeight = 10; Field subject = new Field(10, 10); subject.SetBlock(new BlockHelper.MockBlock(1, blockHeight), new Vector2(2, fieldHeight - blockHeight - 1)); subject.SetContentsForTest(new Color?[,]{ {null,null,null,null,null,null,null,null,null,null}, {null,null,null,null,null,null,null,null,null,null}, {null,null,null,null,null,null,null,null,null,Color.Red}, {null,null,null,null,null,null,null,null,null,null}, {null,null,null,null,null,null,null,null,null,null}, {null,null,null,null,null,null,null,null,null,null}, {null,null,null,null,null,null,null,null,null,null}, {null,null,null,null,null,null,null,null,null,null}, {null,null,null,null,null,null,null,null,null,null}, {null,null,null,null,null,null,null,null,null,null} }); Assert.That(subject.CanAdvance(), Is.False); }