示例#1
0
        public void No_score_for_frame_11()
        {
            var sut = new Scorer();

            var result = sut.Calc_frame_scores(new[] { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 });

            Assert.AreEqual(11, result.Count());
            Assert.AreEqual(0, result.Last());
        }
示例#2
0
        public void Calc_total_score()
        {
            var frames = new[]
                {
                    new Frame{Score=1},
                    new Frame{Score=2},
                    new Frame{}
                };

            var sut = new Scorer();
            var result = sut.Calc_total_score(frames);

            Assert.AreEqual(3, result);
        }
示例#3
0
文件: Program.cs 项目: ralfw/dnp2013
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var ui = new UI();
            var frames = new Frames();
            var scorer = new Scorer();
            var map = new Mappings();
            var integration = new Integration(frames, scorer);

            ui.On_Clear += integration.New_game;
            ui.On_Pins += integration.Register_roll;
            integration.Result += map.Map;
            map.Result += ui.Display;

            integration.Start();

            Application.Run(ui);
        }
示例#4
0
 public Integration(Frames frames, Scorer scorer)
 {
     _frames = frames;
     _scorer = scorer;
 }