System.Xml.Tests.TCValidateElement.CallValidateElementAndCHeckXmlSchemaInfoFOr_Simple_Complex_Empty_Mixed_Element_First_Second_Overload C# (CSharp) Method

CallValidateElementAndCHeckXmlSchemaInfoFOr_Simple_Complex_Empty_Mixed_Element_First_Second_Overload() private method

private CallValidateElementAndCHeckXmlSchemaInfoFOr_Simple_Complex_Empty_Mixed_Element_First_Second_Overload ( String elemType, XmlSchemaContentType schemaContentType, String overload ) : void
elemType String
schemaContentType XmlSchemaContentType
overload String
return void
        public void CallValidateElementAndCHeckXmlSchemaInfoFOr_Simple_Complex_Empty_Mixed_Element_First_Second_Overload(String elemType, XmlSchemaContentType schemaContentType, String overload)
        {
            XmlSchemaValidator val;
            XmlSchemaSet schemas = new XmlSchemaSet();
            XmlSchemaInfo info = new XmlSchemaInfo();
            string name = elemType;

            schemas.Add("", Path.Combine(TestData, XSDFILE_VALIDATE_TEXT));
            schemas.Compile();
            val = CreateValidator(schemas);

            val.Initialize();
            if (overload == "first")
                val.ValidateElement(name, "", info);
            else
                val.ValidateElement(name, "", info, null, null, null, null);

            Assert.Equal(info.ContentType, schemaContentType);
            Assert.Equal(info.Validity, XmlSchemaValidity.NotKnown);
            Assert.Equal(info.SchemaElement, schemas.GlobalElements[new XmlQualifiedName(name)]);
            Assert.Equal(info.IsNil, false);
            Assert.Equal(info.IsDefault, false);
            if (name == "SimpleElement")
                Assert.True(info.SchemaType is XmlSchemaSimpleType);
            else
                Assert.True(info.SchemaType is XmlSchemaComplexType);

            return;
        }