IsPropertyPublicSettable_WithComplexConditionCheckingPropertyIsNotEmptyAndPropertyValueTakeOverInContent_ShouldReturnTrue()
        {
            string propertyName      = "TestProperty";
            string propertyCondition = "$(OtherProperty) == 'value' AND $(TestProperty) != ''";
            string propertyContent   = "$(TestProperty)";

            Assert.IsTrue(
                MsBuildXmlPropertyImplementation.HasPropertyPublicSetter(propertyName, propertyCondition,
                                                                         propertyContent));
        }
        IsPropertyPublicSettable_WithCheckForPropertyIsNotEmptyInConditionAndSetPropertyInContent_ShouldReturnTrue()
        {
            string propertyName      = "TestProperty";
            string propertyCondition = "$(TestProperty) != ''";
            string propertyContent   = "$(TestProperty)";

            Assert.IsTrue(
                MsBuildXmlPropertyImplementation.HasPropertyPublicSetter(propertyName, propertyCondition,
                                                                         propertyContent));
        }
        public void IsPropertyPublicSettable_WithoutConditionAndContent_ShouldReturnFalse()
        {
            string propertyName      = "TestProperty";
            string propertyCondition = string.Empty;
            string propertyContent   = string.Empty;

            Assert.IsFalse(
                MsBuildXmlPropertyImplementation.HasPropertyPublicSetter(propertyName, propertyCondition,
                                                                         propertyContent));
        }
        IsPropertyPublicSettable_WithConditionCheckingSomeOtherPropertiesAndPropertyValueTakeOverInContent_ShouldReturnFalse()
        {
            string propertyName      = "TestProperty";
            string propertyCondition = "$(OtherProperty) == 'value'";
            string propertyContent   = "$(TestProperty)";

            Assert.IsFalse(
                MsBuildXmlPropertyImplementation.HasPropertyPublicSetter(propertyName, propertyCondition,
                                                                         propertyContent));
        }
        public void IsPropertyPublicSettable_WithCheckForPropertyIsEmptyInCondition_ShouldReturnTrue()
        {
            string propertyName      = "TestProperty";
            string propertyCondition = "$(TestProperty) == ''";
            string propertyContent   = string.Empty;

            Assert.IsTrue(
                MsBuildXmlPropertyImplementation.HasPropertyPublicSetter(propertyName, propertyCondition,
                                                                         propertyContent));
        }
        public void IsPropertyPublicSettable_WithCheckForOtherPropertyAndSetOtherPropertyValue_ShouldReturnTrue()
        {
            string propertyName      = "TestProperty";
            string propertyCondition = "$(OtherProperty) != ''";
            string propertyContent   = "$(OtherProperty)";

            Assert.IsTrue(
                MsBuildXmlPropertyImplementation.HasPropertyPublicSetter(propertyName, propertyCondition,
                                                                         propertyContent));
        }
        IsPropertyPublicSettable_WithCheckForPropertyIsNotEmptyInConditionAndNoPropertyValueTakeOverInContent_ShouldReturnFalse()
        {
            string propertyName      = "TestProperty";
            string propertyCondition = "$(TestProperty) != ''";
            string propertyContent   = "SomeOtherValues $(OtherProperty)";

            Assert.IsFalse(
                MsBuildXmlPropertyImplementation.HasPropertyPublicSetter(propertyName, propertyCondition,
                                                                         propertyContent));
        }
Esempio n. 8
0
        public void HasPropertyPublicSetter_WithEmptyConditionAndPropertyNameAsContent_ReturnTrue()
        {
            string propertyContent   = "$(Test)";
            string propertyCondition = null;
            string propertyName      = "Test";

            Assert.IsTrue(
                MsBuildXmlPropertyImplementation.HasPropertyPublicSetter(propertyName, propertyCondition,
                                                                         propertyContent),
                "Property without condition and self set in content should return true");
        }
Esempio n. 9
0
        public void HasPropertyPublicSetter_WithNullContentAndNullCondition_ReturnTrue()
        {
            string propertyContent   = null;
            string propertyCondition = null;
            string propertyName      = "Test";

            Assert.IsFalse(
                MsBuildXmlPropertyImplementation.HasPropertyPublicSetter(propertyName, propertyCondition,
                                                                         propertyContent),
                "Property without content and condition should return false");
        }