Skip to content

Instantly share code, notes, and snippets.

@erikdietrich
Created November 8, 2012 20:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save erikdietrich/4041256 to your computer and use it in GitHub Desktop.
The Integration Tests for the bowling calculator
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