コード例 #1
0
        public void Test_AdvanceIfPossible_WhenNotPossible_ShouldSetNewBlock()
        {
            Mock <IField> field = new Mock <IField>();

            field.Setup(f => f.CanAdvance()).Returns(false);

            GameMechanics subject = new GameMechanics(field.Object, new BlockHelper.MockBlockFactory());

            subject.AdvanceIfPossible();

            field.Verify(f => f.SetBlock(It.IsAny <IBlock>(), It.IsAny <Vector2>()));
        }
コード例 #2
0
        public void Test_AdvanceIfPossible_WhenPossible_ShouldAdvance()
        {
            Mock <IField> field = new Mock <IField>();

            field.Setup(f => f.CanAdvance()).Returns(true);

            GameMechanics subject = new GameMechanics(field.Object, new BlockHelper.MockBlockFactory());

            subject.AdvanceIfPossible();

            field.Verify(f => f.AdvanceBlock());
        }