本文整理汇总了C#中Frame.Throw方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.Throw方法的具体用法?C# Frame.Throw怎么用?C# Frame.Throw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame
的用法示例。
在下文中一共展示了Frame.Throw方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsSpare_ShouldReturnTrue_WhenThereAreTwoThrowsTotalOfTenPins
public void IsSpare_ShouldReturnTrue_WhenThereAreTwoThrowsTotalOfTenPins()
{
var game = new Frame();
game.Throw(9);
game.Throw(1);
Assert.IsTrue(game.IsSpare);
}
示例2: SecondThrow
public void SecondThrow()
{
frame = new Frame(game);
frame.Throw(5);
frame.Throw(3);
Assert.AreEqual(8, game.Score());
}
示例3: IsSpare_ShouldReturnFalse_WhenThereAreTwoThrowsTotalLessThanTen
public void IsSpare_ShouldReturnFalse_WhenThereAreTwoThrowsTotalLessThanTen()
{
var game = new Frame();
game.Throw(1);
game.Throw(1);
Assert.IsFalse(game.IsSpare);
}
示例4: IsStrike_ShouldRetrunFalse_WhenThereAreTwoThrows
public void IsStrike_ShouldRetrunFalse_WhenThereAreTwoThrows()
{
var game = new Frame();
game.Throw(1);
game.Throw(1);
Assert.IsFalse(game.IsStrike);
}
示例5: IsComplete_ShouldReturnTrue_WhenThereAreTwoThrows
public void IsComplete_ShouldReturnTrue_WhenThereAreTwoThrows()
{
var game = new Frame();
game.Throw(1);
game.Throw(0);
Assert.IsTrue(game.IsComplete);
}
示例6: HasSpareTurn
public void HasSpareTurn()
{
frame = new Frame(game);
frame.Throw(1);
frame.Throw(4);
frame.Throw(5);
frame.Throw(5);
frame.Throw(6);
Assert.AreEqual(27, game.Score());
}
示例7: ThirdTurn
public void ThirdTurn()
{
frame = new Frame(game);
frame.Throw(1);
frame.Throw(4);
frame.Throw(4);
frame.Throw(5);
frame.Throw(5);
frame.Throw(4);
Assert.AreEqual(23, game.Score());
}
示例8: Down_ShouldReducePinsLeft
public void Down_ShouldReducePinsLeft()
{
var game = new Frame();
game.Throw(5);
Assert.AreEqual(Frame.TotalPins - 5, game.PinsLeft);
Assert.AreEqual(5, game.PinsDown);
}
示例9: HasAllTurn
public void HasAllTurn()
{
frame = new Frame(game);
frame.Throw(1);
frame.Throw(4);
frame.Throw(4);
frame.Throw(5);
frame.Throw(6);
frame.Throw(4);
frame.Throw(5);
frame.Throw(5);
frame.Throw(10);
frame.Throw(0);
frame.Throw(1);
Assert.AreEqual(61, game.Score());
}
示例10: FirstThrow
public void FirstThrow()
{
frame = new Frame(game);
frame.Throw(5);
Assert.AreEqual(5, game.Score());
}
示例11: IsSpare_ShouldReturnFalse_WhenIsAStrike
public void IsSpare_ShouldReturnFalse_WhenIsAStrike()
{
var game = new Frame();
game.Throw(10);
Assert.IsFalse(game.IsSpare);
}
示例12: IsStrike_ShouldRetrunTrue_WhenThereDownTenPins
public void IsStrike_ShouldRetrunTrue_WhenThereDownTenPins()
{
var game = new Frame();
game.Throw(10);
Assert.IsTrue(game.IsStrike);
}
示例13: IsStrike_ShouldRetrunFalse_WhenThereIsOnyOneThrow_AndIsNotAStrike
public void IsStrike_ShouldRetrunFalse_WhenThereIsOnyOneThrow_AndIsNotAStrike()
{
var game = new Frame();
game.Throw(1);
Assert.IsFalse(game.IsStrike);
}
示例14: IsComplete_ShouldReturnTrue_WhenThrowAStrike
public void IsComplete_ShouldReturnTrue_WhenThrowAStrike()
{
var game = new Frame();
game.Throw(10);
Assert.IsTrue(game.IsComplete);
}