System.Xml.Tests.TCInitialize.InitializeWithAttributeValidate_OtherAttribute_Element_Type C# (CSharp) Méthode

InitializeWithAttributeValidate_OtherAttribute_Element_Type() private méthode

private InitializeWithAttributeValidate_OtherAttribute_Element_Type ( String typeToValidate ) : void
typeToValidate String
Résultat void
        public void InitializeWithAttributeValidate_OtherAttribute_Element_Type(String typeToValidate)
        {
            XmlSchemaValidator val;
            XmlSchemaInfo info = new XmlSchemaInfo();
            XmlSchemaSet schemas = new XmlSchemaSet();

            schemas.Add("", Path.Combine(TestData, XSDFILE_PARTIAL_VALIDATION));
            schemas.Compile();

            val = CreateValidator(schemas);
            val.Initialize(schemas.GlobalAttributes[new XmlQualifiedName("PartialAttribute")]);

            try
            {
                switch (typeToValidate)
                {
                    case "other":
                        val.ValidateAttribute("PartialAttribute2", "", StringGetter("123"), info);
                        break;

                    case "element":
                        val.ValidateElement("PartialElement", "", info);
                        break;

                    case "type":
                        val.ValidateElement("foo", "", info, "PartialType", null, null, null);
                        break;

                    default:
                        Assert.True(false);
                        break;
                }
            }
            catch (XmlSchemaValidationException)
            {
                //XmlExceptionVerifier.IsExceptionOk(e, (string)null);

                return;
            }

            Assert.True(false);
        }