From d8dfb7a3cdc0a2d7e795608b5f5d6997649eabc1 Mon Sep 17 00:00:00 2001 From: Simon Gockner Date: Fri, 22 Nov 2019 16:27:44 +0100 Subject: [PATCH] - add test case (no stack available) --- Test.LightweightIocContainer/IocContainerRecursionTest.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Test.LightweightIocContainer/IocContainerRecursionTest.cs b/Test.LightweightIocContainer/IocContainerRecursionTest.cs index c14f189..9a0c069 100644 --- a/Test.LightweightIocContainer/IocContainerRecursionTest.cs +++ b/Test.LightweightIocContainer/IocContainerRecursionTest.cs @@ -125,6 +125,14 @@ namespace Test.LightweightIocContainer Assert.AreEqual(message, exception.Message); } + [Test] + public void TestCircularDependencyExceptionNoStack() + { + CircularDependencyException circularDependencyException = new CircularDependencyException(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() {