Exemplo n.º 1
0
        public void GetConfigFile_absolutePath_loads(string filename, string accepts, string expected, string baseDir)
        {
            // Arrange
            var appEnvMock = new AppEnvironmentMock(f => f == accepts, f => null)
            {
                AppDomainBaseDirectory = baseDir
            };
            var fileLoader = new LoggingConfigurationFileLoader(appEnvMock);

            // Act
            var result = fileLoader.GetConfigFile(filename);

            // Assert
            Assert.Equal(expected, result);
        }
Exemplo n.º 2
0
        public void GetConfigFile_absolutePath_loads(string filename, string accepts, string expected, string baseDir)
        {
            // Arrange
            var fileMock   = new FileMock(f => f == accepts);
            var fileLoader = new LoggingConfigurationFileLoader(fileMock);
            var appDomain  = LogFactory.CurrentAppDomain;

            try
            {
                LogFactory.CurrentAppDomain = new AppDomainMock(baseDir);

                // Act
                var result = fileLoader.GetConfigFile(filename);

                // Assert
                Assert.Equal(expected, result);
            }
            finally
            {
                //restore
                LogFactory.CurrentAppDomain = appDomain;
            }
        }