GetBuildProperty() public method

public GetBuildProperty ( string propertyName ) : string
propertyName string
return string
        public void ProjectPropertyManager_SetBooleanProperty()
        {
            // Arrange
            var project = new ProjectMock("foo.proj");

            ProjectPropertyManager testSubject = this.CreateTestSubject();

            // Test case 1: true -> property is set true
            // Arrange
            testSubject.SetBooleanProperty(project, TestPropertyName, true);

            // Act + Assert
            project.GetBuildProperty(TestPropertyName).Should().Be(true.ToString(), "Expected property value true for property true");

            // Test case 2: false -> property is set false
            // Arrange
            testSubject.SetBooleanProperty(project, TestPropertyName, false);

            // Act + Assert
            project.GetBuildProperty(TestPropertyName).Should().Be(false.ToString(), "Expected property value true for property true");

            // Test case 3: null -> property is cleared
            // Arrange
            testSubject.SetBooleanProperty(project, TestPropertyName, null);

            // Act + Assert
            project.GetBuildProperty(TestPropertyName).Should().BeNull("Expected property value null for property false");
        }
示例#2
0
        public void ProjectPropertyManager_SetBooleanProperty()
        {
            // Setup
            var project = new ProjectMock("foo.proj");

            ProjectPropertyManager testSubject = this.CreateTestSubject();

            // Test case 1: true -> property is set true
            // Setup
            testSubject.SetBooleanProperty(project, TestPropertyName, true);

            // Act + Verify
            Assert.AreEqual(true.ToString(), project.GetBuildProperty(TestPropertyName),
                            ignoreCase: true, message: "Expected property value true for property true");

            // Test case 2: false -> property is set false
            // Setup
            testSubject.SetBooleanProperty(project, TestPropertyName, false);

            // Act + Verify
            Assert.AreEqual(false.ToString(), project.GetBuildProperty(TestPropertyName),
                            ignoreCase: false, message: "Expected property value true for property true");

            // Test case 3: null -> property is cleared
            // Setup
            testSubject.SetBooleanProperty(project, TestPropertyName, null);

            // Act + Verify
            Assert.IsNull(project.GetBuildProperty(TestPropertyName), "Expected property value null for property false");
        }
        public void ProjectSystemHelper_SetProjectProperty_PropertyDoesNotExist_AddsPropertyWithValue()
        {
            // Arrange
            ProjectMock project = this.solutionMock.AddOrGetProject("my.proj");

            // Act
            testSubject.SetProjectProperty(project, "myprop", "myval");

            // Assert
            project.GetBuildProperty("myprop").Should().Be("myval", "Unexpected property value");
        }
示例#4
0
        public void ProjectSystemHelper_SetProjectProperty_PropertyDoesNotExist_AddsPropertyWithValue()
        {
            // Setup
            ProjectMock project = this.solutionMock.AddOrGetProject("my.proj");

            // Act
            testSubject.SetProjectProperty(project, "myprop", "myval");

            // Verify
            Assert.AreEqual("myval", project.GetBuildProperty("myprop"), "Unexpected property value");
        }
        public void ProjectSystemHelper_ClearProjectProperty_PropertyExists_ClearsProperty()
        {
            // Arrange
            ProjectMock project = this.solutionMock.AddOrGetProject("my.proj");

            project.SetBuildProperty("myprop", "val");

            // Act
            testSubject.ClearProjectProperty(project, "myprop");

            // Assert
            project.GetBuildProperty("myprop").Should().BeNull("Expected property value to be cleared");
        }
        public void ProjectSystemHelper_SetProjectProperty_PropertyExists_OverwritesValue()
        {
            // Arrange
            ProjectMock project = this.solutionMock.AddOrGetProject("my.proj");

            project.SetBuildProperty("myprop", "oldval");

            // Act
            testSubject.SetProjectProperty(project, "myprop", "newval");

            // Assert
            project.GetBuildProperty("myprop").Should().Be("newval", "Unexpected property value");
        }
示例#7
0
        public void ProjectSystemHelper_ClearProjectProperty_PropertyExists_ClearsProperty()
        {
            // Setup
            ProjectMock project = this.solutionMock.AddOrGetProject("my.proj");

            project.SetBuildProperty("myprop", "val");

            // Act
            testSubject.ClearProjectProperty(project, "myprop");

            // Verify
            Assert.IsNull(project.GetBuildProperty("myprop"), "Expected property value to be cleared");
        }
示例#8
0
        public void ProjectSystemHelper_SetProjectProperty_PropertyExists_OverwritesValue()
        {
            // Setup
            ProjectMock project = this.solutionMock.AddOrGetProject("my.proj");

            project.SetBuildProperty("myprop", "oldval");

            // Act
            testSubject.SetProjectProperty(project, "myprop", "newval");

            // Verify
            Assert.AreEqual("newval", project.GetBuildProperty("myprop"), "Unexpected property value");
        }
        public void ProjectPropertyManager_SetBooleanProperty()
        {
            // Setup
            var project = new ProjectMock("foo.proj");

            ProjectPropertyManager testSubject = this.CreateTestSubject();

            // Test case 1: true -> property is set true
            // Setup
            testSubject.SetBooleanProperty(project, TestPropertyName, true);

            // Act + Verify
            Assert.AreEqual(true.ToString(), project.GetBuildProperty(TestPropertyName),
                ignoreCase: true, message: "Expected property value true for property true");

            // Test case 2: false -> property is set false
            // Setup
            testSubject.SetBooleanProperty(project, TestPropertyName, false);

            // Act + Verify
            Assert.AreEqual(false.ToString(), project.GetBuildProperty(TestPropertyName),
                ignoreCase: false, message: "Expected property value true for property true");

            // Test case 3: null -> property is cleared
            // Setup
            testSubject.SetBooleanProperty(project, TestPropertyName, null);

            // Act + Verify
            Assert.IsNull(project.GetBuildProperty(TestPropertyName), "Expected property value null for property false");
        }