From 930bd9ca8a23718341d7799aa3aff817e7face5e Mon Sep 17 00:00:00 2001 From: theKBro Date: Thu, 1 Sep 2022 11:05:34 +0200 Subject: [PATCH] improve error message --- Test.LightweightIocContainer.Validation/IocValidatorTest.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Test.LightweightIocContainer.Validation/IocValidatorTest.cs b/Test.LightweightIocContainer.Validation/IocValidatorTest.cs index 484bc40..4a35639 100644 --- a/Test.LightweightIocContainer.Validation/IocValidatorTest.cs +++ b/Test.LightweightIocContainer.Validation/IocValidatorTest.cs @@ -150,13 +150,13 @@ public class IocValidatorTest if (aggregateException?.InnerExceptions[0] is not NoMatchingConstructorFoundException noMatchingConstructorFoundException) { - Assert.Fail("inner exception is not of type NoMatchingConstructorFoundException"); + Assert.Fail($"{nameof(aggregateException.InnerExceptions)} is not of type {nameof(NoMatchingConstructorFoundException)}"); return; } if (noMatchingConstructorFoundException.InnerExceptions[0] is not ConstructorNotMatchingException iTest2CtorNotMatchingException) { - Assert.Fail("inner exception is not of type ConstructorNotMatchingException"); + Assert.Fail($"{nameof(aggregateException.InnerExceptions)} is not of type {nameof(ConstructorNotMatchingException)}"); return; } @@ -182,6 +182,6 @@ public class IocValidatorTest if (exception is NoMatchingConstructorFoundException noMatchingConstructorFoundException) Assert.AreEqual(typeof(T), noMatchingConstructorFoundException.Type); else - Assert.Fail($"Exception is no NoMatchingConstructorFoundException, actual type: {exception?.GetType()}"); + Assert.Fail($"Exception is no {nameof(NoMatchingConstructorFoundException)}, actual type: {exception?.GetType()}"); } } \ No newline at end of file