public void GetRawScoreAccountsForPreviousRollWhenCalculatingSpare()
 {
     Frame f = new Frame();
     f.AddRoll(new Roll('1'));
     f.AddRoll(new Roll('/'));
     Assert.AreEqual(10, f.GetRawScore());
 }
 public void GetRollScoreCanBeUsedToGetASingleRollsScore()
 {
     Frame f = new Frame();
     f.AddRoll(new Roll('1'));
     f.AddRoll(new Roll('8'));
     Assert.AreEqual(1, f.GetRollScore(0));
     Assert.AreEqual(8, f.GetRollScore(1));
 }
        public void GetRawScoreAccountsForPreviousRollWhenCalculatingSpare()
        {
            Frame f = new Frame();

            f.AddRoll(new Roll('1'));
            f.AddRoll(new Roll('/'));
            Assert.AreEqual(10, f.GetRawScore());
        }
        public void OverfillFrameThrowsFrameFullExceptionWhenAddingTooManyRolls()
        {
            Frame f = new Frame(2);

            f.AddRoll(new Roll('-'));
            f.AddRoll(new Roll('-'));
            f.AddRoll(new Roll('-'));
        }
        public void GetRollScoreCanBeUsedToGetASingleRollsScore()
        {
            Frame f = new Frame();

            f.AddRoll(new Roll('1'));
            f.AddRoll(new Roll('8'));
            Assert.AreEqual(1, f.GetRollScore(0));
            Assert.AreEqual(8, f.GetRollScore(1));
        }
        public void GetRawScoreAddsRollsAsRawValues()
        {
            Frame f = new Frame();
            f.AddRoll(new Roll('1'));
            Assert.AreEqual(1, f.GetRawScore());
            f.AddRoll(new Roll('X'));

            // 12 because X is technically 11
            Assert.AreEqual(12, f.GetRawScore());
        }
        public void GetRawScoreAddsRollsAsRawValues()
        {
            Frame f = new Frame();

            f.AddRoll(new Roll('1'));
            Assert.AreEqual(1, f.GetRawScore());
            f.AddRoll(new Roll('X'));

            // 12 because X is technically 11
            Assert.AreEqual(12, f.GetRawScore());
        }
 public void GetRollReturnsSameObjectThatWasPlacedAtGivenIndex()
 {
     Roll r1 = new Roll('5');
     Frame f = new Frame();
     f.AddRoll(r1);
     Assert.AreSame(r1, f.GetRoll(0));
 }
        public void AddRollIncreasesFrameSize()
        {
            Frame f = new Frame();

            f.AddRoll(new Roll('-'));
            Assert.AreEqual(1, f.Size);
        }
        public void GetRollScoreThrowsExceptionWhenIndexIsOutOfRange()
        {
            Frame f = new Frame();

            f.AddRoll(new Roll('7'));
            Assert.AreEqual(0, f.GetRollScore(10));
        }
        public void GetRollReturnsSameObjectThatWasPlacedAtGivenIndex()
        {
            Roll  r1 = new Roll('5');
            Frame f  = new Frame();

            f.AddRoll(r1);
            Assert.AreSame(r1, f.GetRoll(0));
        }
 public void GetRollScoreThrowsExceptionWhenIndexIsOutOfRange()
 {
     Frame f = new Frame();
     f.AddRoll(new Roll('7'));
     Assert.AreEqual(0, f.GetRollScore(10));
 }
 public void AddRollIncreasesFrameSize()
 {
     Frame f = new Frame();
     f.AddRoll(new Roll('-'));
     Assert.AreEqual(1, f.Size);
 }
 public void OverfillFrameThrowsFrameFullExceptionWhenAddingTooManyRolls()
 {
     Frame f = new Frame(2);
     f.AddRoll(new Roll('-'));
     f.AddRoll(new Roll('-'));
     f.AddRoll(new Roll('-'));
 }