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

IntializeWithTypeValidate_OtherType_Attribute() private méthode

private IntializeWithTypeValidate_OtherType_Attribute ( String typeToValidate ) : void
typeToValidate String
Résultat void
        public void IntializeWithTypeValidate_OtherType_Attribute(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.GlobalTypes[new XmlQualifiedName("PartialType")]);

            try
            {
                switch (typeToValidate)
                {
                    case "other":
                        val.ValidateElement("foo", "", info, "PartialType2", null, null, null);
                        break;

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

                    case "attribute":
                        val.ValidateAttribute("PartialAttribute", "", StringGetter("123"), info);
                        break;

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

                return;
            }

            Assert.True(false);
        }