public void CanDuckTypeLoggingConfigurationLegacyInLegacyNlog() { var instance = new LoggingConfiguration(); instance.DuckCast <LoggingConfigurationLegacyProxy>(); instance.TryDuckCast(out LoggingConfigurationLegacyProxy duck).Should().BeTrue(); duck.Should().NotBeNull(); duck.ConfiguredNamedTargets.Should().BeEmpty(); }
public void CanDuckTypeLoggingConfigurationInModernNlog() { var instance = new LoggingConfiguration(); instance.DuckCast <ILoggingConfigurationProxy>(); instance.TryDuckCast(out ILoggingConfigurationProxy duck).Should().BeTrue(); duck.Should().NotBeNull(); duck.ConfiguredNamedTargets.Cast <object>().Should().BeEmpty(); }
public void CanDuckTypeLoggingConfigurationLegacyPre43InAncientNlog() { var instance = new LoggingConfiguration(); instance.LoggingRules.Should().BeEmpty(); instance.DuckCast <LoggingConfigurationPre43Proxy>(); instance.TryDuckCast(out LoggingConfigurationPre43Proxy duck).Should().BeTrue(); duck.Should().NotBeNull(); duck.ConfiguredNamedTargets.Should().BeEmpty(); var rule = new LoggingRule(); duck.LoggingRules.Add(rule); instance.LoggingRules.Should().ContainSingle().Which.Should().Be(rule); }