public void FrameWithStrikeThrowIsDone() { var frame = new Frame(); frame.AddThrow(10); Assert.AreEqual(true, frame.IsDone()); }
public void FrameWithOneRegularThrowIsNotDone() { var frame = new Frame(); frame.AddThrow(1); Assert.AreEqual(false, frame.IsDone()); }
public void FrameWithStrikeIsStrike() { var frame = new Frame(); frame.AddThrow(10); Assert.IsTrue(frame.IsStrike()); }
private Frame AddNewFrame() { var frame = new Frame(); _frames.Add(frame); return frame; }
public void FrameWithTwoRegularThrowIsDone() { var frame = new Frame(); frame.AddThrow(1); frame.AddThrow(1); Assert.AreEqual(true, frame.IsDone()); }
public void FrameWithSpareThrowIsDone() { var frame = new Frame(); frame.AddThrow(4); frame.AddThrow(6); Assert.AreEqual(true, frame.IsDone()); }
public void FrameWithSpareIsSpare() { var frame = new Frame(); frame.AddThrow(4); frame.AddThrow(6); Assert.IsTrue(frame.IsSpare()); }
public void FrameWithNoThrowsIsNotStrike() { var frame = new Frame(); Assert.IsFalse(frame.IsStrike()); }
private int CalculateScore(Frame frame, int currentFrameNumber) { int score = frame.ScoreInFrame(); if (frame.IsSpare()) { score += CalculateSpareScore(currentFrameNumber); } else if (frame.IsStrike()) { score += CalculateStrikeScore(currentFrameNumber); } return score; }