private static Frame CreateFrame(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 CreateFrame(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 LastFrameShouldSimplyAddUpAllItsBalls() { //given var lastFrame=new LastFrame(1,9,2); //when int score= lastFrame.Score; //then Assert.AreEqual(12,score); }
public void NinethFrameShouldIncludeNext2BallsAsBonusWhenThereAre2ConsectiveStrikes() { //given Frame frame=new Frame(10,0); LastFrame frame2=new LastFrame(10,2,3); frame.Next = frame2; //when int score=frame.Score; //then Assert.AreEqual(22,score); }