您好,我在bizunit 4.0中创建了一个名为test1.xml的xml测试用例
我遇到的问题是如何运行测试。我找到的所有示例都是针对bizunit 2.0和3.0的,但不是针对4.0的。在我发现的示例中,它说要这样做:
BizUnit.BizUnit bizUnit = new BizUnit.BizUnit("testl.xml");
bizUnit.RunTest();但我收到一张纸条说它已被弃用。
发布于 2012-05-10 03:39:51
我正在使用.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();发布于 2014-03-12 22:56:03
对我来说,这是有效的(没有警告):
TestCase tc = TestCase.LoadFromFile("test1.xml");
BizUnit.BizUnit bizUnit = new BizUnit.BizUnit(tc);
bizUnit.RunTest();https://stackoverflow.com/questions/10014479
复制相似问题