当前位置: 首页>>代码示例>>C#>>正文


C# GameBoard.PutChip方法代码示例

本文整理汇总了C#中GameBoard.PutChip方法的典型用法代码示例。如果您正苦于以下问题:C# GameBoard.PutChip方法的具体用法?C# GameBoard.PutChip怎么用?C# GameBoard.PutChip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameBoard的用法示例。


在下文中一共展示了GameBoard.PutChip方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSequences_gets_sequences

        public void GetSequences_gets_sequences()
        {
            // Arrange.
            var sut = new GameBoard();
            sut.PutChip(1, 2, Team.A);
            sut.PutChip(1, 3, Team.A);
            sut.PutChip(1, 4, Team.A);
            sut.PutChip(1, 5, Team.A);
            sut.PutChip(1, 6, Team.A);

            // Act.
            var sequences = sut.GetSequences();

            // Assert.
            Assert.That(sequences, Has.Count.EqualTo(1));
            Assert.That(sequences.First().Team, Is.EqualTo(Team.A));
        }
开发者ID:jbfp,项目名称:Sequence_old,代码行数:17,代码来源:GameBoardTests.cs

示例2: PutChip_sets_chip_on_coordinate

        public void PutChip_sets_chip_on_coordinate()
        {
            // Arrange.
            const int row = 1;
            const int column = 1;
            var sut = new GameBoard();

            // Act.
            sut.PutChip(row, column, Team.A);

            // Assert.
            Assert.That(sut.IsFree(row, column), Is.False);
        }
开发者ID:jbfp,项目名称:Sequence_old,代码行数:13,代码来源:GameBoardTests.cs

示例3: PutChip_throws_InvalidOperationException_when_coordinate_is_shared

        public void PutChip_throws_InvalidOperationException_when_coordinate_is_shared()
        {
            // Arrange.
            const int row = 0;
            const int column = 0;
            var sut = new GameBoard();

            // Act.
            TestDelegate test = () => sut.PutChip(row, column, Team.A);

            // Assert.
            Assert.That(GameBoard.IsShared(row, column), Is.True);
            Assert.That(test, Throws.InvalidOperationException);
        }
开发者ID:jbfp,项目名称:Sequence_old,代码行数:14,代码来源:GameBoardTests.cs

示例4: PutChip_throws_ArgumentOutOfRangeException_when_team_is_not_A_or_B

        public void PutChip_throws_ArgumentOutOfRangeException_when_team_is_not_A_or_B(Team team, bool succeeds)
        {
            // Arrange.
            var sut = new GameBoard();

            // Act.
            TestDelegate test = () => sut.PutChip(1, 1, team);

            // Assert.
            if (succeeds)
            {
                Assert.That(test, Throws.Nothing);
            }
            else
            {
                Assert.That(test, Throws.TypeOf<ArgumentOutOfRangeException>());
            }
        }
开发者ID:jbfp,项目名称:Sequence_old,代码行数:18,代码来源:GameBoardTests.cs

示例5: RemoveChip_removes_chip_from_coordinate

        public void RemoveChip_removes_chip_from_coordinate()
        {
            // Arrange.
            const int row = 1;
            const int column = 1;
            var sut = new GameBoard();
            sut.PutChip(row, column, Team.A);

            // Assume.
            Assume.That(sut.IsFree(row, column), Is.False);

            // Act.
            sut.RemoveChip(row, column);

            // Assert.
            Assert.That(sut.IsFree(row, column), Is.True);
        }
开发者ID:jbfp,项目名称:Sequence_old,代码行数:17,代码来源:GameBoardTests.cs


注:本文中的GameBoard.PutChip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。