本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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>());
}
}
示例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);
}