public void SetResolverToCustomValidateSomethignChangeResolverThenVerify()
{
CXmlTestResolver res = new CXmlTestResolver();
CResolverHolder holder = new CResolverHolder();
res.CalledResolveUri += new XmlTestResolverEventHandler(holder.CallBackResolveUri);
res.CalledGetEntity += new XmlTestResolverEventHandler(holder.CallBackGetEntity);
XmlNamespaceManager manager = new XmlNamespaceManager(new NameTable());
XmlSchemaInfo info = new XmlSchemaInfo();
XmlSchemaValidator val = new XmlSchemaValidator(new NameTable(),
new XmlSchemaSet(),
manager,
AllFlags);
val.XmlResolver = res;
val.Initialize();
val.ValidateElement("foo", "", null, "type1", null, null, TestData + XSDFILE_NO_TARGET_NAMESPACE);
val.SkipToEndElement(null);
Assert.True(holder.IsCalledResolveUri);
Assert.True(holder.IsCalledGetEntity);
val.XmlResolver = new XmlUrlResolver();
holder.IsCalledGetEntity = false;
holder.IsCalledResolveUri = false;
val.ValidateElement("foo", "", null, "type1", null, null, TestData + XSDFILE_NO_TARGET_NAMESPACE);
Assert.True(!holder.IsCalledResolveUri);
Assert.True(!holder.IsCalledGetEntity);
return;
}