我使用的.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();
來源
2012-05-09 19:39:51
Jay