public void FrameShouldCountScoreWhenThereIsNoBonus() { //given var frame = new Frame(2, 3); //when var score = frame.Score; //then Assert.AreEqual(5, score); }
public void FrameShouldIncludeNextTwoBallsAsBonusWhenThereIsStrike() { //given var frame = new Frame(10, 0); var frame2 = new Frame(3, 4); frame.Next = frame2; //when var score = frame.Score; //then Assert.AreEqual(17, score); }
public void FrameShouldIncludeNextTwoBallsAsBonusWhenNextToStrikeIsLastFrame() { //given var frame = new Frame(10, 0); var frame2 = new LastFrame(10, 3, 4); frame.Next = frame2; //when var score = frame.Score; //then Assert.AreEqual(23, score); }
public void FrameShouldIncludeNextOneBallAsBonusWhenThereIsSpare() { //given var frame = new Frame(2, 8); var frame2 = new Frame(3, 4); frame.Next = frame2; //when var score = frame.Score; //then Assert.AreEqual(13, score); }
private Frame CreateFrame(int firstBall, int secondBall, int thirdBall) { Frame frame; if (thirdBall == -1) { frame = new Frame(firstBall, secondBall); } else { CheckLastPosition(); frame = new LastFrame(firstBall, secondBall, thirdBall); } return frame; }
public void FrameShouldIncludeNextTwoBallsAsBonusWhenThereAre2StrikesInARow() { //given var frame = new Frame(10, 0); var frame2 = new Frame(10, 0); var frame3 = new Frame(3, 4); frame.Next = frame2; frame2.Next = frame3; //when var score = frame.Score; //then Assert.AreEqual(23, score); }
public void FrameShouldNotHaveTwoBallsSumBiggerThan10() { var frame = new Frame(7, 5); var score = frame.Score; }
public void FrameShouldNotHaveAnyBallBiggerThan10() { var frame = new Frame(11, 12); var score = frame.Score; }