Created
November 8, 2012 20:14
-
-
Save erikdietrich/4041256 to your computer and use it in GitHub Desktop.
The Integration Tests for the bowling calculator
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 | |
{ | |
[TestClass] | |
public class IntegrationTest | |
{ | |
private BowlingScoreCalculator Target { get; set; } | |
[TestInitialize] | |
public void BeforeEachTest() | |
{ | |
Target = new BowlingScoreCalculator(); | |
} | |
[TestMethod, Owner("ebd"), TestCategory("Proven"), TestCategory("Unit")] | |
public void SampleGame_For_Mary() | |
{ | |
Target.BowlFrame(new Frame(9, 0)); | |
Target.BowlFrame(new Frame(3, 7)); | |
Target.BowlFrame(new Frame(6, 1)); | |
Target.BowlFrame(new Frame(3, 7)); | |
Target.BowlFrame(new Frame(8, 1)); | |
Target.BowlFrame(new Frame(5, 5)); | |
Target.BowlFrame(new Frame(0, 10)); | |
Target.BowlFrame(new Frame(8, 0)); | |
Target.BowlFrame(new Frame(7, 3)); | |
Target.BowlFrame(new TenthFrame(8, 2, 8)); | |
Assert.AreEqual<int>(131, Target.Score); | |
} | |
[TestMethod, Owner("ebd"), TestCategory("Proven"), TestCategory("Unit")] | |
public void SampleGame_For_Kim() | |
{ | |
Target.BowlFrame(Frame.Strike); | |
Target.BowlFrame(new Frame(3, 7)); | |
Target.BowlFrame(new Frame(6, 1)); | |
Target.BowlFrame(Frame.Strike); | |
Target.BowlFrame(Frame.Strike); | |
Target.BowlFrame(Frame.Strike); | |
Target.BowlFrame(new Frame(2, 8)); | |
Target.BowlFrame(new Frame(9, 0)); | |
Target.BowlFrame(new Frame(7, 3)); | |
Target.BowlFrame(new TenthFrame(10, 10, 10)); | |
Assert.AreEqual<int>(193, Target.Score); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment