コード例 #1
0
        public void Act_ShouldReturnExpectedCellWhenCenterAvailable()
        {
            //Arrange
            FakeCell                     expectedCell         = new FakeCell.Builder().Value("4").Build();
            FakeSelectMoveAction         fakeSelectMoveAction = new FakeSelectMoveAction.Builder().Build();
            FakeBoard                    fakeBoard            = new FakeBoard.Builder().Available(Bool.True).Build();
            CenterSquareSelectMoveAction subject = new CenterSquareSelectMoveAction(fakeSelectMoveAction);

            //Act
            ICell cell = subject.Act(fakeBoard, null, null);

            //Assert
            cell.Value().Should().Be(expectedCell.Value());
        }
コード例 #2
0
        public void Act_ShouldReturnAvailableCell()
        {
            //Arrange
            FakeCell  expected  = new FakeCell.Builder().Value("1").Build();
            FakeBoard fakeBoard = new FakeBoard.Builder()
                                  .Available(Bool.False, Bool.False, Bool.False, Bool.True).Build();
            FakeCell              fakeCell        = new FakeCell.Builder().Build();
            FakePlayer            fakePlayer      = new FakePlayer.Builder().Cell(fakeCell).Build();
            FakePlayer            fakePlayerOther = new FakePlayer.Builder().Build();
            FakeMoveInput         fakeMoveInput   = new FakeMoveInput.Builder().Input(new Glyph('1')).Build();
            HumanSelectMoveAction subject         = new HumanSelectMoveAction(fakeMoveInput);

            //Act
            ICell actual = subject.Act(fakeBoard, fakePlayer, fakePlayerOther);

            //Assert
            actual.Value().Should().Be(expected.Value());
        }