System.Xml.Tests.TCInitialize.InitializeWithElementValidate_OtherElement_Type_Attribute C# (CSharp) Method

InitializeWithElementValidate_OtherElement_Type_Attribute() private method

private InitializeWithElementValidate_OtherElement_Type_Attribute ( String typeToValidate ) : void
typeToValidate String
return void
        public void InitializeWithElementValidate_OtherElement_Type_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.GlobalElements[new XmlQualifiedName("PartialElement")]);

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

                    case "type":
                        val.ValidateElement("foo", "", info, "PartialType", null, null, null);
                        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);
        }