Testing XML Schema.
Step 1:Create Schema.Xsd
Step 2:
Create Instance of Schema.Xsd
<ns0:Employee xmlns:ns0="http://Company.Demo.Schemas.Employee">
<FirstName>Kumar</FirstName>
<LastName>Janssen</LastName>
<SocialSecurityNumber>330409710</SocialSecurityNumber>
<Type>Full</Type>
<Function>Manager</Function>
<Salary>50000</Salary>
<Bonus>1000</Bonus>
<Pension>1000000</Pension>
</ns0:Employee>
Step 3:
Bizunit
Method for testing Instance.xml
[TestMethod]
public void
TestEmployeeSchema()
{
var employeeTest = new
TestCase { Name = "Test
Schema.Xsd Schema" };
//Create the file validate step
var validatingFileReadStep = new
FileReadMultipleStep
{
DirectoryPath = @"..\..\..\Company.Demo\Company.Demo.Sample.Schemas",
SearchPattern = "Instance.xml",
ExpectedNumberOfFiles = 1,
Timeout = 3000,
DeleteFiles = false
};
//Create an XML Validation step
//This will
check the result against the XSD for the Employee document
var validation = new XmlValidationStep();
var employeeSchema = new
SchemaDefinition
{
XmlSchemaPath =
@"..\..\..\Company.Demo\Company.Demo.Schemas\Sample.xsd",
XmlSchemaNameSpace = "http://Company.Demo.Schemas.Employee"
};
validation.XmlSchemas.Add(employeeSchema);
validatingFileReadStep.SubSteps.Add(validation);
employeeTest.ExecutionSteps.Add(validatingFileReadStep);
//Execute Tests
var bizUnit = new
BizUnit.BizUnit(employeeContractTest);
bizUnit.RunTest();
}
could you please provide similar similar code for flat file validation as well? i tried a lot with multiple options but not getting any where
ReplyDeleteEnable unit testing of Biztalk Project , then try code
ReplyDeleteTestableSchemaBase _Schema = new SchemaName();
bool result = _Schema.ValidateInstance(@"FilePath", OutputInstanceType.XML);
Assert.IsTrue(result, "Validation Failed");
TestableSchemaBase _Schema = new SchemaName_FF();
bool result = _Schema.ValidateInstance(@"TextFilePath", OutputInstanceType.Native);
Assert.IsTrue(result, "Validation Failed");
Biztalk server online training - 21st Century Software Solutions
ReplyDeletehttp://www.21cssindia.com/courses/biztalk-server-online-training-213.html
ఈ పేజీని అనువదించు
biztalk server online training, biztalk server training, biztalk server online training visakhapatnam, biztalk 2010 online training, microsoft biztalk online training, ...
Biztalk admin online training - 21st Century Software Solutions
http://www.21cssindia.com/courses/biztalk-admin-online-training-220.html
ఈ పేజీని అనువదించు
biztalk admin online training, biztalk admin training, biztalk server online training, biztalk server training, biztalk admin course contents, biztalk admin enquiry, .Courses at 21st Century Software Solutions
Talend Online Training -Hyperion Online Training - IBM Unica Online Training -
Siteminder Online Training - SharePoint Online Training - Informatica Online Training
SalesForce Online Training - Many more… | Call Us +917386622889
Visit: http://www.21cssindia.com/courses.html
Artcile was simply superb. Keep sharing...
ReplyDeleteBiztalk Online Training Hyderabad
it's very nice blog
ReplyDeleteBiztalk online Bangalore
Very Very Nice Blog Selenium Course Online Training In Hyderabad
ReplyDeleteVery interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
ReplyDeleteDigital Marketing Training in Chennai
Digital Marketing Course in Chennai
Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
ReplyDeletepython Training in chennai
python Course in chennai
kayseriescortu.com - alacam.org - xescortun.com
ReplyDeletemmorpg oyunlar
ReplyDeleteınstagram takipci satın al
tiktok jeton hilesi
Tiktok Jeton Hilesi
ANTALYA SAC EKİM
referans kimliği nedir
instagram takipçi satın al
Instagram Takipci Satın Al
metin2 pvp serverlar