Aspects.Logging.Tests.Configuration.Concrete.ConfigFileConfigurationProviderTests.WhenPassingInAConfigurationWithNoViableLoggersShouldThrowException C# (CSharp) Method

WhenPassingInAConfigurationWithNoViableLoggersShouldThrowException() private method

        public void WhenPassingInAConfigurationWithNoViableLoggersShouldThrowException()
        {
            ConfigFileConfigurationProvider sut = new ConfigFileConfigurationProvider();
            Mock<IConfigFileSource> mock = new Mock<IConfigFileSource>();
            mock.Setup(source => source.Logger).Returns(string.Empty);
            mock.Setup(source => source.UseConsoleLogger).Returns(false);
            mock.Setup(source => source.IsEnabled).Returns(true);
            sut.ConfigFileSource = mock.Object;

            ILogger result = null;
            try
            {
                result = sut.GetLogger();
            }
            catch (Exception e)
            {
                e.Should().BeOfType<ConfigurationErrorsException>();
            }

            result.Should().BeNull("Because an exception has been thrown");
        }