Exemple #1
0
            public void WhenBuildWebApplication_IfWebAppFound_ShouldDeploy()
            {
                // Arrange
                _mock.MockWebServerDeployWebApp();
                var server = new MockWebServer(new WebServerSettings(), _dependencies);

                server.WebApplicationInfo = _mock.MockWebApplicationInfo;

                // Act
                server.DeployWebApplication(_mock.MockCreateWebSiteName, _mock.MockDeploymentList);
            }
Exemple #2
0
            public void WhenBuildWebApplication_IfWebAppNotFound_ShouldThrow()
            {
                // Arrange
                var server = new MockWebServer(new WebServerSettings(), _dependencies);

                // Act
                var exception = Assert.Throws <Exception>(
                    () => server.DeployWebApplication("someapp", null));

                // Assert
                Assert.Equal(string.Format("Web Application not found on web server: '{0}'", "someapp"), exception.Message);
            }
Exemple #3
0
            public void WhenSetCustomHeaders_IfWebConfigExists_ShouldOverwrite()
            {
                // Arrange
                _mock.MockSetCustomHeadersWithWebConfig();

                var server = new MockWebServer(new WebServerSettings(), _dependencies);

                // Act
                server.SetCustomHeaders(_mock.MockWebConfigPath, new Dictionary <string, string>
                {
                    { "header1", "value1" },
                    { "header2", "value2" }
                });
            }
Exemple #4
0
            public void WhenBuildWebApplication_IfProjectNameIsNotEmpty_ShouldUseProjectName()
            {
                // Arrange
                _mock.MockBuildHelperWithProjectName();
                TestEasyHelpers.Builder = _mock.BuildHelper.Object;

                var server = new MockWebServer
                {
                    WebApplicationInfo = new WebApplicationInfo
                    {
                        PhysicalPath = _mock.MockUniqueTempPath,
                        Name         = _mock.MockCreateWebSiteName
                    }
                };

                // Act
                server.BuildWebApplication(_mock.MockCreateWebSiteName, _mock.MockProjectName);
            }
            public void WhenSetCustomHeaders_IfWebConfigExists_ShouldOverwrite()
            {
                // Arrange  
                _mock.MockSetCustomHeadersWithWebConfig();

                var server = new MockWebServer(new WebServerSettings(), _dependencies);

                // Act
                server.SetCustomHeaders(_mock.MockWebConfigPath, new Dictionary<string, string>
                {
                    { "header1", "value1" },
                    { "header2", "value2" }
                });
            } 
            public void WhenBuildWebApplication_IfProjectNameIsNotEmpty_ShouldUseProjectName()
            {
                // Arrange  
                _mock.MockBuildHelperWithProjectName();
                TestEasyHelpers.Builder = _mock.BuildHelper.Object;

                var server = new MockWebServer
                {
                    WebApplicationInfo = new WebApplicationInfo
                    {
                        PhysicalPath = _mock.MockUniqueTempPath,
                        Name = _mock.MockCreateWebSiteName
                    }
                };

                // Act
                server.BuildWebApplication(_mock.MockCreateWebSiteName, _mock.MockProjectName);
            }    
            public void WhenBuildWebApplication_IfWebAppFound_ShouldDeploy()
            {
                // Arrange  
                _mock.MockWebServerDeployWebApp();
                var server = new MockWebServer(new WebServerSettings(), _dependencies);
                server.WebApplicationInfo = _mock.MockWebApplicationInfo;

                // Act
                server.DeployWebApplication(_mock.MockCreateWebSiteName, _mock.MockDeploymentList);
            }
            public void WhenBuildWebApplication_IfWebAppNotFound_ShouldThrow()
            {
                // Arrange  
                var server = new MockWebServer(new WebServerSettings(), _dependencies);

                // Act
                var exception = Assert.Throws<Exception>(
                    () => server.DeployWebApplication("someapp", null));

                // Assert 
                Assert.Equal(string.Format("Web Application not found on web server: '{0}'", "someapp"), exception.Message);
            }