Esempio n. 1
0
        public void InvalidAttributeOnMetadatum()
        {
            XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum();

            XmlTestUtilities.AddAttribute(group.ChildNodes[0].ChildNodes[0], "XXXX", "YYY");
            ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group);
        }
Esempio n. 2
0
        public void FalseConditionOnMetadatum()
        {
            XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum();

            XmlTestUtilities.AddAttribute(group.ChildNodes[0].ChildNodes[0], "Condition", "'v2'=='$(p1)'");
            ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group);

            // No exception
            Assertion.AssertEquals(0, definitions.GetDefaultedMetadataCount("arbitrary"));
        }
Esempio n. 3
0
        public void TrueConditionOnEverything()
        {
            XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum();

            XmlTestUtilities.AddAttribute(group.ChildNodes[0], "Condition", "'v1'=='$(p1)'");
            XmlTestUtilities.AddAttribute(group.ChildNodes[0].ChildNodes[0], "Condition", "'v1'=='$(p1)'");
            XmlTestUtilities.AddAttribute(group.ChildNodes[0].ChildNodes[0], "Condition", "'v1'=='$(p1)'");
            ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group);

            Assertion.AssertEquals(1, definitions.GetDefaultedMetadataCount("CCompile"));
            Assertion.AssertEquals("DEBUG", definitions.GetDefaultMetadataValue("CCompile", "Defines"));
        }