Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.