执行BizUnit 4.0 XML测试用例

时间:2012-04-04 15:37:45

标签: biztalk biztalk-2010 bizunit

您好我在bizunit 4.0中创建了一个名为test1.xml

的xml测试用例

我遇到的问题是如何运行测试。我找到的所有示例都适用于bizunit 2.0和3.0,但不适用于4.0。在示例中我发现它说:

 BizUnit.BizUnit bizUnit = new BizUnit.BizUnit("testl.xml");
 bizUnit.RunTest();

但我得到一条说明已被弃用的说明。

2 个答案:

答案 0 :(得分:2)

我正在使用.net单元测试并从代码中调用bizunit

这是一个例子

    // create list of files
    TestGeneratedFiles = new System.Collections.Generic.List<String>();

    var TestCase = new BizUnit.Xaml.TestCase { Name = "Interface128UnitTestSetup" };

    //Create the file validate step
    var testStep = new FileReadMultipleStep
    {
        DirectoryPath = inputPath,
        SearchPattern = InputTemplate,
        ExpectedNumberOfFiles = 1,
        Timeout = 3000,
        DeleteFiles = false
    };

    //Create an XML Validation step
    //This will check against the XSD for the document
    var validation = new XmlValidationStep();
    var schemaSummary = new SchemaDefinition
    {
        // test deployment copies this file to test directory
        XmlSchemaPath = @"Publish_Employee.xsd",
        XmlSchemaNameSpace = "http://AMC.Oracle.Employee"
    };
    validation.XmlSchemas.Add(schemaSummary);

    TestCase.ExecutionSteps.Add(testStep);

    // run the test case
    var bizUnit = new BizUnit.BizUnit(TestCase);
    bizUnit.RunTest();

答案 1 :(得分:1)

对我来说,这有效(没有警告):

TestCase tc = TestCase.LoadFromFile("test1.xml");
BizUnit.BizUnit bizUnit = new BizUnit.BizUnit(tc);
bizUnit.RunTest();
相关问题