From 0ee10c8ba91407599ada9cd74e4f713f48bf8cff Mon Sep 17 00:00:00 2001 From: Simon G Date: Fri, 18 Sep 2020 22:38:31 +0200 Subject: [PATCH] - add OpenGenericRegistrationTest --- .../OpenGenericRegistrationTest.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Test.LightweightIocContainer/OpenGenericRegistrationTest.cs diff --git a/Test.LightweightIocContainer/OpenGenericRegistrationTest.cs b/Test.LightweightIocContainer/OpenGenericRegistrationTest.cs new file mode 100644 index 0000000..d5d5ff4 --- /dev/null +++ b/Test.LightweightIocContainer/OpenGenericRegistrationTest.cs @@ -0,0 +1,34 @@ +// Author: Simon Gockner +// Created: 2020-09-18 +// Copyright(c) 2020 SimonG. All Rights Reserved. + +using LightweightIocContainer; +using LightweightIocContainer.Interfaces; +using NUnit.Framework; + +namespace Test.LightweightIocContainer +{ + [TestFixture] + public class OpenGenericRegistrationTest + { + public interface ITest + { + + } + + public class Test : ITest + { + + } + + [Test] + public void TestRegisterOpenGenericType() + { + IIocContainer iocContainer = new IocContainer(); + iocContainer.Register(typeof(ITest<>), typeof(Test<>)); + + ITest test = iocContainer.Resolve>(); + Assert.NotNull(test); + } + } +} \ No newline at end of file