From 6b865c8e5fe6abd37c574b5e9b97ee90fa732cd4 Mon Sep 17 00:00:00 2001 From: Bastian Buchholz Date: Sat, 3 Jan 2015 19:15:15 +0100 Subject: [PATCH] logger format exception tests should not be language specific --- .../Logging/Loggers/BaseLoggerTests.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Griffin.Framework/Griffin.Core.Tests/Logging/Loggers/BaseLoggerTests.cs b/src/Griffin.Framework/Griffin.Core.Tests/Logging/Loggers/BaseLoggerTests.cs index deb0809..32fe6a7 100644 --- a/src/Griffin.Framework/Griffin.Core.Tests/Logging/Loggers/BaseLoggerTests.cs +++ b/src/Griffin.Framework/Griffin.Core.Tests/Logging/Loggers/BaseLoggerTests.cs @@ -212,7 +212,7 @@ public void format_a_simple_exception() var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); - actual.Should().Be(" System.NotImplementedException: The method or operation is not implemented.\r\n"); + actual.Should().StartWith(" System.NotImplementedException"); } [Fact] @@ -223,7 +223,8 @@ public void include_property_in_the_exception_output() var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); - actual.Should().Be(" Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty: Exception of type 'Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty' was thrown.\r\n [UserId='10']\r\n"); + actual.Should().StartWith(" Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty"); + actual.Should().EndWith("[UserId='10']\r\n"); } [Fact] @@ -234,7 +235,8 @@ public void include_properties_in_the_exception_output() var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); - actual.Should().Be(" Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2: Exception of type 'Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2' was thrown.\r\n [UserId='10',FirstName='Arne']\r\n"); + actual.Should().StartWith(" Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2"); + actual.Should().EndWith("[UserId='10',FirstName='Arne']\r\n"); } [Fact] @@ -245,7 +247,8 @@ public void ignore_null_properties_in_the_exception_output() var sut = new BaseLoggerWrapper(GetType()); var actual = sut.FormatException(exception); - actual.Should().Be(" Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2: Exception of type 'Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2' was thrown.\r\n [UserId='10']\r\n"); + actual.Should().StartWith(" Griffin.Core.Tests.Logging.Loggers.ExceptionWithProperty2"); + actual.Should().EndWith("[UserId='10']\r\n"); } }