コード例 #1
0
        public void Dispose_CalledOnce_ShouldCallDisposeOnOutputOnce()
        {
            var output = new LogOutputStub();

            var instance = new Logger(output);

            instance.Dispose();

            output.DisposeCount.Should().Be(1);
        }
コード例 #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.Should().Be(PluginManager.MessageType.Message);
        }
コード例 #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.Should().Be(1);
        }
コード例 #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.Should().Be(1);
        }
コード例 #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.Should().Contain(message);
        }