Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        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");
        }