From e062031aac021ad12f6d35e5509aa1987c0e50b8 Mon Sep 17 00:00:00 2001 From: Simon G Date: Fri, 17 Dec 2021 08:52:27 +0100 Subject: [PATCH] - remove not needed code --- .../Exceptions/CircularDependencyException.cs | 2 +- Test.LightweightIocContainer/IocContainerRecursionTest.cs | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/LightweightIocContainer/Exceptions/CircularDependencyException.cs b/LightweightIocContainer/Exceptions/CircularDependencyException.cs index 1aa9678..6d9f064 100644 --- a/LightweightIocContainer/Exceptions/CircularDependencyException.cs +++ b/LightweightIocContainer/Exceptions/CircularDependencyException.cs @@ -44,7 +44,7 @@ namespace LightweightIocContainer.Exceptions get { StringBuilder message = new($"Circular dependency has been detected when trying to resolve `{ResolvingType}`.\n"); - if (ResolveStack == null || !ResolveStack.Any()) + if (!ResolveStack.Any()) return message.ToString(); message.Append("Resolve stack that resulted in the circular dependency:\n"); diff --git a/Test.LightweightIocContainer/IocContainerRecursionTest.cs b/Test.LightweightIocContainer/IocContainerRecursionTest.cs index 1e0c67d..b8f8952 100644 --- a/Test.LightweightIocContainer/IocContainerRecursionTest.cs +++ b/Test.LightweightIocContainer/IocContainerRecursionTest.cs @@ -134,14 +134,6 @@ namespace Test.LightweightIocContainer Assert.AreEqual(message, exception.Message); } - [Test] - public void TestCircularDependencyExceptionNoStack() - { - CircularDependencyException circularDependencyException = new(typeof(IFoo), null); - string message = $"Circular dependency has been detected when trying to resolve `{typeof(IFoo)}`.\n"; - Assert.AreEqual(message, circularDependencyException.Message); - } - [Test] public void TestNonCircularDependencies() {