public void GetWebProjectProperties_NoExistingWebProjectPropertiesInMSBuildProject_ReturnsWebProjectPropertiesWithDefaultValues()
        {
            CreateWebProject();
            WebProjectProperties properties = webProject.GetWebProjectProperties();

            Assert.AreEqual(WebProject.DefaultProperties, properties);
        }
        void CreateMSBuildProjectWithWebProjectProperties()
        {
            CreateMSBuildProject();
            var properties = new WebProjectProperties();
            var extension  = new VisualStudioProjectExtension(properties);

            extension.Save(msbuildProject);
        }
        public void Constructor_WebPropertyPropertiesXElementHasNoChildElements_ExceptionNotThrown()
        {
            var element    = new XElement("WebPropertyProperties");
            var properties = new WebProjectProperties(element);

            Assert.AreEqual(String.Empty, properties.IISUrl);
            Assert.AreEqual(String.Empty, properties.CustomServerUrl);
        }
        public void Constructor_XElementHasNTLMAuthentication_NTLMAuthenticationPropertyPopulated()
        {
            var properties = new WebProjectProperties()
            {
                NTLMAuthentication = true
            };

            properties = new WebProjectProperties(properties.ToXElement());

            Assert.IsTrue(properties.NTLMAuthentication);
        }
        public void Constructor_XElementHasDevelopmentServerVPath_DevelopmentServerVPathPropertyPopulated()
        {
            var properties = new WebProjectProperties()
            {
                DevelopmentServerVPath = "Test"
            };

            properties = new WebProjectProperties(properties.ToXElement());

            Assert.AreEqual("Test", properties.DevelopmentServerVPath);
        }
        public void Constructor_XElementHasUseCustomServer_UseCustomServerPropertyPopulated()
        {
            var properties = new WebProjectProperties()
            {
                UseCustomServer = true
            };

            properties = new WebProjectProperties(properties.ToXElement());

            Assert.IsTrue(properties.UseCustomServer);
        }
        public void IsConfigured_UseIISAndUseIISExpressAreBothFalse_ReturnsFalse()
        {
            var properties = new WebProjectProperties()
            {
                UseIISExpress = false, UseIIS = false
            };

            bool configured = properties.IsConfigured();

            Assert.IsFalse(configured);
        }
        public void Constructor_XElementHasSaveServerSettingsInUserFile_SaveServerSettingsInUserFilePropertyPopulated()
        {
            var properties = new WebProjectProperties()
            {
                SaveServerSettingsInUserFile = true
            };

            properties = new WebProjectProperties(properties.ToXElement());

            Assert.IsTrue(properties.SaveServerSettingsInUserFile);
        }
        public void Constructor_XElementHasUseIIS_UseIISPropertyPopulated()
        {
            var properties = new WebProjectProperties()
            {
                UseIIS = true
            };

            properties = new WebProjectProperties(properties.ToXElement());

            Assert.IsTrue(properties.UseIIS);
        }
        public void Constructor_XElementHasAutoAssignPort_AutoAssignPortPropertyPopulated()
        {
            var properties = new WebProjectProperties()
            {
                AutoAssignPort = true
            };

            properties = new WebProjectProperties(properties.ToXElement());

            Assert.IsTrue(properties.AutoAssignPort);
        }
        public void Constructor_XElementHasCustomServerUrl_CustomServerUrlPropertyPopulated()
        {
            var properties = new WebProjectProperties()
            {
                CustomServerUrl = "/Test"
            };

            properties = new WebProjectProperties(properties.ToXElement());

            Assert.AreEqual("/Test", properties.CustomServerUrl);
        }
        public void IsConfigured_UseIISIsTrueAndIISUrlIsNull_ReturnsFalse()
        {
            var properties = new WebProjectProperties
            {
                UseIISExpress = true,
                IISUrl        = null
            };

            bool configured = properties.IsConfigured();

            Assert.IsFalse(configured);
        }
        public void IsConfigured_UseIISExpressIsTrueAndIISUrlIsEmptyString_ReturnsFalse()
        {
            var properties = new WebProjectProperties
            {
                UseIISExpress = true,
                IISUrl        = String.Empty
            };

            bool configured = properties.IsConfigured();

            Assert.IsFalse(configured);
        }
        public void IsConfigured_UseIISExpressIsTrueAndIISUrlIsValidUrl_ReturnsTrue()
        {
            var properties = new WebProjectProperties
            {
                UseIISExpress = true,
                IISUrl        = "http://localhost:8080/"
            };

            bool configured = properties.IsConfigured();

            Assert.IsTrue(configured);
        }
Esempio n. 15
0
        public void GetWebProjectProperties_MSBuildHasUseIISExpressPropertySetToTrue_UseIISExpressPropertyIsTrue()
        {
            CreateWebProjectFromMSBuildProjectWithWebProjectProperties();
            SetUseIISExpressInMSBuildProjectToTrue();

            var properties = webProject.GetWebProjectProperties();

            var expectedProperties = new WebProjectProperties {
                UseIISExpress = true
            };

            Assert.AreEqual(expectedProperties, properties);
        }
Esempio n. 16
0
        public void UpdateWebProjectProperties_UseIISExpressIsTrue_MSBuildProjectIISExpressPropertySetToTrue()
        {
            CreateWebProject();
            var properties = new WebProjectProperties {
                UseIISExpress = true
            };

            webProject.UpdateWebProjectProperties(properties);

            string value = msbuildProject.GetEvaluatedProperty("UseIISExpress");

            Assert.AreEqual("True", value);
        }
Esempio n. 17
0
        public void GetWebProjectProperties_MSBuildHasWebProjectProperties_ReadsWebProjectPropertiesFromMSBuildProject()
        {
            var expectedProperties = new WebProjectProperties
            {
                DevelopmentServerPort = 8989,
                IISUrl = "http://localhost:8989/test"
            };

            CreateWebProjectFromMSBuildProjectWithWebProjectProperties(expectedProperties);

            WebProjectProperties properties = webProject.GetWebProjectProperties();

            Assert.AreEqual(expectedProperties, properties);
        }
Esempio n. 18
0
        public void UpdateWebProjectProperties_SaveServerSettingsInUserFileIsFalse_SavesPropertiesToMainProjectFile()
        {
            CreateWebProject();
            WebProjectProperties properties = webProject.GetWebProjectProperties();

            properties.SaveServerSettingsInUserFile = false;
            properties.DevelopmentServerPort        = 7777;
            properties.DevelopmentServerVPath       = "/";
            properties.IISUrl = "http://*****:*****@"<ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID=""{349C5851-65DF-11DA-9384-00065B846F21}"">
        <WebProjectProperties>
          <UseIIS>True</UseIIS>
          <AutoAssignPort>False</AutoAssignPort>
          <DevelopmentServerPort>7777</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>http://localhost:7777/test</IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>False</UseCustomServer>
          <CustomServerUrl></CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>";

            Assert.AreEqual(expectedMSBuildProjectFileContents, msbuildProjectFileContents);
        }
 void CreateTwoWebProjectProperties()
 {
     lhs = new WebProjectProperties();
     rhs = new WebProjectProperties();
 }
Esempio n. 20
0
 void CreateWebProjectFromMSBuildProjectWithWebProjectProperties(WebProjectProperties properties)
 {
     CreateWebProject();
     webProject.UpdateWebProjectProperties(properties);
     CreateWebProject(msbuildProject);
 }