public void create_example_test() { var test = new Test("test1"); test.Section("a"); test.Section("b"); test.Section("c"); new FixtureLibrary().ModifyExampleTest(test); test.Name.ShouldEqual("All Fixtures"); test.Parts.ShouldHaveTheSameElementsAs<ITestPart>(test.Parts); }
public void creates_example_test() { var template = new Test("some test"); Section section = template.Section("Math"); section.AddStep("step1"); section.AddStep("step2"); section.AddStep("step3"); new FixtureGraph("Math").ModifyExampleTest(template); template.Parts.Count.ShouldEqual(1); template.Parts[0].ShouldBeOfType<Section>(); }
public void create_example_test() { var test = new Test("some test"); test.Section("a"); test.Section("b"); test.Section("c"); Section section = new Section("Math").WithStep("MultiplyBy").WithStep("step1").WithStep("step2"); test.Add(section); var structure = new StubGrammarStructure { Name = "MultiplyBy", Parent = new FixtureGraph("Math") }; structure.ModifyExampleTest(test); test.Parts.Count.ShouldEqual(1); var theSection = test.Parts[0].ShouldBeOfType<Section>(); theSection.Parts.Count.ShouldEqual(1); theSection.Parts[0].ShouldBeOfType<IStep>().GrammarKey.ShouldEqual("MultiplyBy"); }
public void give_it_a_whirl() { var test = new Test("The First Test"); test.Section<ArithmeticFixture>(x => { x.WithStep("StartWith", "starting:100") .WithStep("MultiplyBy", "multiplier:2") .WithStep("TheValueShouldBe", "expected:200") .WithStep("TheValueShouldBe", "expected:300") .WithStep("Subtract", "operand:5") .WithStep("TheValueShouldBe", "expected:195") .WithStep("Adding", "x:10, y:23.5, returnValue:33.5") .WithStep("Throw"); }); var runner = new TestRunner(); HtmlDocument html = runner.WritePreview(test); }
public void SetUp() { test = new Test("The First Test"); test.Section<ArithmeticFixture>(x => { x.WithStep("StartWith", "starting:100") .WithStep("MultiplyBy", "multiplier:2") .WithStep("TheValueShouldBe", "expected:200") .WithStep("TheValueShouldBe", "expected:300") .WithStep("Subtract", "operand:5") .WithStep("Subtract", "") .WithStep("TheValueShouldBe", "expected:195") .WithStep("Adding", "x:10, y:23.5, returnValue:33.5") .WithStep("Throw"); }); var runner = new TestRunner(); runner.RunTest(test); }