public void AddEditInvalidImport(String testDir, String testFile, int expCountGT, int expCountGE)
{
string xsd = Path.Combine(path, testDir, testFile);
XmlSchemaSet ss = new XmlSchemaSet();
XmlSchema Schema = XmlSchema.Read(XmlReader.Create(xsd), null);
XmlSchema Schema1 = ss.Add(Schema);
ValidateSchemaSet(ss, 1, false, 0, 0, 0, "Validation after add");
ss.Compile();
ValidateSchemaSet(ss, 1, true, expCountGT, expCountGE, 0, "Validation after add/comp");
XmlSchemaImport imp = new XmlSchemaImport();
imp.Namespace = "ns-a";
imp.SchemaLocation = "reprocess_v9_a.xsd";
Schema.Includes.Add(imp);
try
{
ss.Reprocess(Schema);
Assert.True(false);
}
catch (XmlSchemaException e)
{
_output.WriteLine(e.Message);
}
ValidateSchemaSet(ss, 1, false, 1, 0, 0, "Validation after repr");
try
{
ss.Compile();
Assert.True(false);
}
catch (XmlSchemaException e)
{
_output.WriteLine(e.Message);
}
ValidateSchemaSet(ss, 1, false, 1, 0, 0, "Validation after repr/comp");
try
{
ValidateWithSchemaInfo(ss);
Assert.True(false);
}
catch (XmlSchemaValidationException e)
{
_output.WriteLine(e.Message);
}
return;
}