public void 引数なしのCalculateScoreを呼ぶと10が取得できる() { int actual = _target.CaluculateScore(); int expected = 10; Assert.AreEqual(expected, actual); }
public void 引数が2つのCaluculateScoreを呼ぶと21が取得できる() { int actual = _target.CaluculateScore(_nextFrame, _nextNextFrame); int expected = 10 + 10 + 1; Assert.AreEqual(expected, actual); }
public void 引数が1つのCaluculateScoreを呼ぶと13が取得できる() { int actual = _target.CaluculateScore(_nextFrame); int expected = 10 + 1 + 2; Assert.AreEqual(expected, actual); }
public int CaluculateScore() { int score = 0; for (int i = 0; i < 8; i++) { Frame current = _frameList[i]; Frame next = _frameList[i + 1]; Frame nextnext = _frameList[i + 2]; score += current.CaluculateScore(next, nextnext); } score += _frameList[8].CaluculateScore(_frameList[9]); score += _frameList[9].CaluculateScore(); return(score); }