Created
May 2, 2014 23:39
-
-
Save TheSecretSquad/85b7357b01269eec68dd to your computer and use it in GitHub Desktop.
Bowling Score Calculator Kata from Daedtech.com Alternative Design Question - http://www.daedtech.com/tdd-for-breaking-problems-apart-3-finishing-up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace ScratchPadTest | |
{ | |
public class Frames | |
{ | |
private readonly Frame[] _frames = new Frame[10]; | |
private int _currentFrame; | |
public void Push(Frame frame) | |
{ | |
_frames[_currentFrame++] = frame; | |
} | |
public Frame Last { get { return BackFromLast(1); } } | |
public Frame BackFromLast(int number) | |
{ | |
return _frames[_currentFrame - number]; | |
} | |
public int Count { get { return _currentFrame; } } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment