Example #1
0
        public void Dispose_CalledOnce_ShouldCallDisposeOnOutputOnce()
        {
            var output = new LogOutputStub();

            var instance = new Logger(output);

            instance.Dispose();

            output.DisposeCount.ShouldBe(1);
        }
Example #2
0
        public void Info_CalledOnce_ShouldCallLogMessageWithTypeMessage()
        {
            var fixture = new Fixture();

            var output = new LogOutputStub();

            var instance = new Logger(output);

            instance.Info(fixture.Create <string>());

            output.LogMessages.Single().Key.ShouldBe(PluginManager.MessageType.Message);
        }
Example #3
0
        public void Info_CalledOnce_ShouldCallLogMessageOnce()
        {
            var fixture = new Fixture();

            var output = new LogOutputStub();

            var instance = new Logger(output);

            instance.Info(fixture.Create <string>());

            output.LogMessageCount.ShouldBe(1);
        }
Example #4
0
        public void LogException_CalledOnce_ShouldCallLogMessageTwice()
        {
            var fixture = new Fixture();

            var output = new LogOutputStub();

            var instance = new Logger(output);

            instance.LogException(fixture.Create <Exception>());

            output.LogExceptionsCount.ShouldBe(1);
        }
Example #5
0
        public void Info_CalledOnce_ShouldCallLogMessageWithMessage()
        {
            var fixture = new Fixture();

            var output = new LogOutputStub();

            var instance = new Logger(output);

            var message = fixture.Create <string>();

            instance.Info(message);

            output.LogMessages.Single().Value.ShouldContain(message);
        }