System.Xml.Tests.TCGetExpectedParticles.CheckExpectedElements C# (CSharp) Method

CheckExpectedElements() private method

private CheckExpectedElements ( XmlSchemaParticle result, XmlQualifiedName names ) : void
result System.Xml.Schema.XmlSchemaParticle
names System.Xml.XmlQualifiedName
return void
        private void CheckExpectedElements(XmlSchemaParticle[] result, XmlQualifiedName[] names)
        {
            int cntFound;

            Assert.Equal(result.Length, names.Length);

            foreach (XmlSchemaParticle res in result)
                Assert.True(res is XmlSchemaElement);

            foreach (XmlQualifiedName n in names)
            {
                cntFound = 0;
                foreach (XmlSchemaParticle res in result)
                {
                    if (n == (res as XmlSchemaElement).QualifiedName)
                        cntFound++;
                }
                Assert.True(cntFound != 0);
                Assert.True(cntFound <= 1);
            }
        }
    }