예제 #1
0
            public void WhenGetApplicationProperty_IfAppExist_ShouldReturnProperty()
            {
                // Arrange
                const string configPath = "app.config";

                _mock.MockIisExpressConfig_ApplicationConfigFound(configPath)
                .MockIisExpressConfig_RealDocumentInitialized(configPath);

                // Act
                var config   = new IisExpressConfig(configPath, _mock.FileSystem.Object);
                var property = config.GetApplicationProperty("", "physicalPath");

                // Assert
                Assert.Equal(@"%IIS_SITES_HOME%\WebSite1", property);
            }
예제 #2
0
            public void WhenGetApplicationProperty_IfAppNotFound_ShouldReturnNull()
            {
                // Arrange
                const string configPath = "app.config";

                _mock.MockIisExpressConfig_ApplicationConfigFound(configPath)
                .MockIisExpressConfig_RealDocumentInitialized(configPath);

                // Act
                var config   = new IisExpressConfig(configPath, _mock.FileSystem.Object);
                var property = config.GetApplicationProperty("unknownapp", "unknownproperty");

                // Assert
                Assert.Null(property);
            }
예제 #3
0
            public void WhenGetApplicationProperty_IfAppExist_ShouldReturnProperty()
            {
                // Arrange 
                const string configPath = "app.config";
                _mock.MockIisExpressConfig_ApplicationConfigFound(configPath)
                    .MockIisExpressConfig_RealDocumentInitialized(configPath);

                // Act
                var config = new IisExpressConfig(configPath, _mock.FileSystem.Object);
                var property = config.GetApplicationProperty("", "physicalPath");

                // Assert 
                Assert.Equal(@"%IIS_SITES_HOME%\WebSite1", property);
            }
예제 #4
0
            public void WhenGetApplicationProperty_IfAppNotFound_ShouldReturnNull()
            {
                // Arrange 
                const string configPath = "app.config";
                _mock.MockIisExpressConfig_ApplicationConfigFound(configPath)
                    .MockIisExpressConfig_RealDocumentInitialized(configPath);

                // Act
                var config = new IisExpressConfig(configPath, _mock.FileSystem.Object);
                var property = config.GetApplicationProperty("unknownapp", "unknownproperty");

                // Assert 
                Assert.Null(property);
            }