public void ShouldGiveCurrentSetNumberWhenNotCompleted()
        {
            var bowlingGame = new BowlingService();
            var score       = RollBall(0, 9, bowlingGame);

            Assert.AreEqual(5, bowlingGame.SetNumber);
        }
        public void ShouldGiveNextSetNumberWhenCompleted()
        {
            var bowlingGame = new BowlingService();
            var score       = RollBall(0, 10, bowlingGame);

            Assert.AreEqual(6, bowlingGame.SetNumber);
        }
        public void ShouldReturnZeroIfAllGutter()
        {
            var bowlingGame = new BowlingService();
            var score       = RollBall(0, 20, bowlingGame);

            Assert.AreEqual(0, score);
        }
        public void ShouldReturnScoreAfterEachRoll()
        {
            var bowlingGame = new BowlingService();
            var score       = RollBall(4, 3, bowlingGame);

            Assert.AreEqual(12, score);
        }
        public void ShouldShowGameCompletedWhenAllSetsComplete()
        {
            var bowlingGame = new BowlingService();
            var score       = RollBall(10, 13, bowlingGame);

            //score = RollBall(4, 2, bowlingGame);
            Assert.AreEqual(true, bowlingGame.IsGameOver);
        }
        public void ShouldNotAddScoreWhenGameCompleted()
        {
            var bowlingGame = new BowlingService();
            var score       = RollBall(10, 13, bowlingGame);

            //score = RollBall(4, 2, bowlingGame);
            Assert.AreEqual(300, score);
        }
        public void ShouldGive300IfAllStrike()
        {
            var bowlingGame = new BowlingService();
            var score       = RollBall(10, 12, bowlingGame);

            //score = RollBall(4, 2, bowlingGame);
            Assert.AreEqual(300, score);
        }
        public void ShouldGiveBonusIfSpare()
        {
            var bowlingGame = new BowlingService();
            var score       = RollBall(5, 2, bowlingGame);

            score = RollBall(4, 2, bowlingGame);
            Assert.AreEqual(22, score);
        }
        public void ShouldGiveNextSetNumberWhenStrike()
        {
            var bowlingGame = new BowlingService();
            var score       = RollBall(4, 2, bowlingGame);

            score = RollBall(10, 1, bowlingGame);
            Assert.AreEqual(3, bowlingGame.SetNumber);
        }
Beispiel #10
0
        public async Task Can_InVoke_Service()
        {
            var bowlingApi = new BowlingApiService(new ApiService());
            var calculator = new BowlingCalculator(new FrameLinker());

            var sut = new BowlingService(bowlingApi, calculator);

            var result = await sut.ValidateResults();

            Assert.IsTrue(result.Result);
        }
Beispiel #11
0
 public BowlingServiceTests()
 {
     service = new BowlingService();
 }
Beispiel #12
0
 public GameController(BowlingService bowlingService)
 {
     BowlingService = bowlingService;
 }
        public void SetupBowlingSession()
        {
            BowlingService bowlingService = new BowlingService();

            bowlingGameAPI = new BowlingGameController(bowlingService);
        }