public void LoggedTypeWithLogDebugWillWriteToLog() { var listener = new TestTraceListener(); listener.ExpectCategory("[DEBUG]"); listener.ExpectOutput("[DEBUG] FluentBoilerplate.Tests.Runtime.Providers.Logging.LogProviderTests+Debug.DebugTest = System.String \"Test Value\""); Trace.Listeners.Add(listener); var instance = new DebugTest { Value = "TestValue" }; this.provider.Debug("Test message", instance); listener.ReadTrace.Should().BeTrue("because we should have received a log message"); }
public void LoggedTypeWithLogDebugWillWriteToLog() { var listener = new TestTraceListener(); listener.ExpectCategory("[DEBUG]"); listener.ExpectOutput("[DEBUG] FluentBoilerplate.Tests.Runtime.Providers.Logging.LogProviderTests+Debug.DebugTest = System.String \"Test Value\""); Trace.Listeners.Add(listener); var instance = new DebugTest { Value = "TestValue" }; this.provider.Debug("Test message", instance); listener.ReadTrace.Should().BeTrue("because we should have received a log message"); }