private static Frame FrameFactory(int firstBall, int secondBall, int thirdBall) { var frame = new Frame(firstBall, secondBall); if (thirdBall != -1) { frame = new LastFrame(firstBall, secondBall, thirdBall); } return frame; }
private static Frame FrameFactory(int firstBall, int secondBall, int thirdBall) { var frame = new Frame(firstBall, secondBall); if (thirdBall != -1) { frame = new LastFrame(firstBall, secondBall, thirdBall); } return(frame); }
public void LastFrameShouldSimplyCountItsScoreAsThreeBallsSum() { //given var lastFrame = new LastFrame(1, 2, 3); //when var score = lastFrame.Score; //then Assert.AreEqual(6, score); }
public void FrameShouldCountItsScoreWithNext2BallsAsBonusWhenNextFrameIsLast() { //given var frame = new Frame(10, 0); var nextFrame = new LastFrame(10, 3, 4); frame.Next = nextFrame; //when var score = frame.Score; //then Assert.AreEqual(23, score); }