本文整理汇总了C#中System.Test.Section方法的典型用法代码示例。如果您正苦于以下问题:C# Test.Section方法的具体用法?C# Test.Section怎么用?C# Test.Section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Test
的用法示例。
在下文中一共展示了Test.Section方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: create_example_test
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);
}
示例2: creates_example_test
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>();
}
示例3: create_example_test
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");
}
示例4: give_it_a_whirl
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);
}
示例5: SetUp
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);
}