Esempio n. 1
0
		public void BeBust_IfRemainsOne()
		{
			var turn2 = new Turn(2);
			var res = turn2.WithAdditionalThrow(new ThrowResult(1, SectionArea.Single));
			Assert.IsTrue(res.Finished);
			Assert.IsTrue(res.Bust);
			Assert.AreEqual(2, res.ScoreAfter);
		}
Esempio n. 2
0
		public void NotBeBust_IfFinishWithDouble()
		{
			var turn2 = new Turn(2);
			var res = turn2.WithAdditionalThrow(new ThrowResult(1, SectionArea.Double));
			Assert.IsTrue(res.Finished);
			Assert.IsFalse(res.Bust);
			Assert.AreEqual(0, res.ScoreAfter);
		}
Esempio n. 3
0
		public void BeBust_IfLastThrowIsNotDouble()
		{
			var turn2 = new Turn(2);
			turn2 = turn2.WithAdditionalThrow(new ThrowResult(2, SectionArea.Single));
			Assert.IsTrue(turn2.Finished);
			Assert.IsTrue(turn2.Bust);
			Assert.AreEqual(2, turn2.ScoreAfter);
		}
Esempio n. 4
0
		public void NotBeBust_IfFinishWithDoubleAfterCoubleOfThrows()
		{
			var turn2 = new Turn(4);
			var res = turn2.WithAdditionalThrow(ThrowResult.Outside)
			.WithAdditionalThrow(new ThrowResult(2, SectionArea.Single))
			.WithAdditionalThrow(new ThrowResult(1, SectionArea.Double));
			Assert.IsTrue(res.Finished);
			Assert.IsFalse(res.Bust);
			Assert.AreEqual(0, res.ScoreAfter);
		}