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


C# Frame.Throw方法代码示例

本文整理汇总了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);
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:7,代码来源:FrameTest.cs

示例2: SecondThrow

 public void SecondThrow()
 {
     frame = new Frame(game);
     frame.Throw(5);
     frame.Throw(3);
     Assert.AreEqual(8, game.Score());
 }
开发者ID:xuanhuanfeng,项目名称:BowlingBallGame,代码行数:7,代码来源:BowlingTest.cs

示例3: IsSpare_ShouldReturnFalse_WhenThereAreTwoThrowsTotalLessThanTen

 public void IsSpare_ShouldReturnFalse_WhenThereAreTwoThrowsTotalLessThanTen()
 {
     var game = new Frame();
     game.Throw(1);
     game.Throw(1);
     Assert.IsFalse(game.IsSpare);
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:7,代码来源:FrameTest.cs

示例4: IsStrike_ShouldRetrunFalse_WhenThereAreTwoThrows

 public void IsStrike_ShouldRetrunFalse_WhenThereAreTwoThrows()
 {
     var game = new Frame();
     game.Throw(1);
     game.Throw(1);
     Assert.IsFalse(game.IsStrike);
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:7,代码来源:FrameTest.cs

示例5: IsComplete_ShouldReturnTrue_WhenThereAreTwoThrows

 public void IsComplete_ShouldReturnTrue_WhenThereAreTwoThrows()
 {
     var game = new Frame();
     game.Throw(1);
     game.Throw(0);
     Assert.IsTrue(game.IsComplete);
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:7,代码来源:FrameTest.cs

示例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());
        }
开发者ID:xuanhuanfeng,项目名称:BowlingBallGame,代码行数:12,代码来源:BowlingTest.cs

示例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());
        }
开发者ID:xuanhuanfeng,项目名称:BowlingBallGame,代码行数:13,代码来源:BowlingTest.cs

示例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);

        }
开发者ID:david--liu,项目名称:code_kata,代码行数:9,代码来源:FrameTest.cs

示例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());
        }
开发者ID:xuanhuanfeng,项目名称:BowlingBallGame,代码行数:21,代码来源:BowlingTest.cs

示例10: FirstThrow

 public void FirstThrow()
 {
     frame = new Frame(game);
     frame.Throw(5);
     Assert.AreEqual(5, game.Score());
 }
开发者ID:xuanhuanfeng,项目名称:BowlingBallGame,代码行数:6,代码来源:BowlingTest.cs

示例11: IsSpare_ShouldReturnFalse_WhenIsAStrike

 public void IsSpare_ShouldReturnFalse_WhenIsAStrike()
 {
     var game = new Frame();
     game.Throw(10);
     Assert.IsFalse(game.IsSpare);
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:6,代码来源:FrameTest.cs

示例12: IsStrike_ShouldRetrunTrue_WhenThereDownTenPins

 public void IsStrike_ShouldRetrunTrue_WhenThereDownTenPins()
 {
     var game = new Frame();
     game.Throw(10);
     Assert.IsTrue(game.IsStrike);
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:6,代码来源:FrameTest.cs

示例13: IsStrike_ShouldRetrunFalse_WhenThereIsOnyOneThrow_AndIsNotAStrike

 public void IsStrike_ShouldRetrunFalse_WhenThereIsOnyOneThrow_AndIsNotAStrike()
 {
     var game = new Frame();
     game.Throw(1);
     Assert.IsFalse(game.IsStrike);
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:6,代码来源:FrameTest.cs

示例14: IsComplete_ShouldReturnTrue_WhenThrowAStrike

 public void IsComplete_ShouldReturnTrue_WhenThrowAStrike()
 {
     var game = new Frame();
     game.Throw(10);
     Assert.IsTrue(game.IsComplete);
 }
开发者ID:david--liu,项目名称:code_kata,代码行数:6,代码来源:FrameTest.cs


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