示例#1
0
        public void test_playing_ball_results_in_different_outcome()
        {
            MockRandomNumberGenerator mock = new MockRandomNumberGenerator(0);
            outcomes outcome = new Batsman(mock).Play(FOUR_RUNS);

            Assert.Equal(NO_RUNS, outcome);
        }
示例#2
0
        public void test_a_valid_event_is_returned()
        {
            MockRandomNumberGenerator mock = new MockRandomNumberGenerator(2);
            Ball     ball    = new Ball(mock);
            outcomes outcome = ball.Bowl();

            Assert.Equal(2, (int)outcome);
        }
示例#3
0
        public void test_no_run()
        {
            MockRandomNumberGenerator mock = new MockRandomNumberGenerator(1);
            Game     thisGame     = new Game(mock);
            outcomes outcomeFinal = thisGame.Play();

            Assert.Equal(ONE_RUN, outcomeFinal);
        }