public void TestFluentCreation()
        {
            var settings = InjectionSettings
                           .WithInjectionMode(InjectionMode.Scoped)
                           .WithRootNamespace("Someroot")
                           .LimitImplementationsToInterfaceNamespace()
                           .WithInterfacePrefix("I")
                           .WithInterfaceSuffixes(new List <string> {
                "Repository", "Service"
            })
                           .WithStrictNaming();

            Assert.True(settings.InterfaceRootNamespaces.Count > 0);

            var settings2 = InjectionSettings
                            .WithInjectionMode(InjectionMode.Scoped)
                            .WithRootNamespaces("Someroot", "someOtherRoot")
                            .LimitImplementationsToInterfaceNamespace()
                            .WithInterfacePrefix("I")
                            .WithInterfaceSuffixes(new List <string> {
                "Repository", "Service"
            })
                            .WithStrictNaming();

            Assert.True(settings2.InterfaceRootNamespaces.Count > 1);
        }
        public void WhenObjectsAreSpecified_AsExplicitImplementationNamespaceProviders_ThenTheNamespaceIsAddedToTheImplementationNamespaceListExpectedNumberOfTimes(List <string> rootNamespaces, int expectedCount, IEnumerable <Type> types)
        {
            var settings = InjectionSettings
                           .WithInjectionMode(InjectionMode.Scoped)
                           .WithRootNamespacesOf(typeof(TestObjects.TestObject1))
                           .AllowImplementationsInNamespacesOf(types)
                           .WithInterfacePrefix("I")
                           .WithInterfaceSuffixes(new List <string> {
                "Repository", "Service"
            })
                           .WithStrictNaming();

            Assert.Equal(expectedCount, settings.AllowedImplementationNamespaces.Count);
            Assert.True(settings.AllowedImplementationNamespaces.All(rootNamespaces.Contains));
        }
        public void WhenObjectIsSpecified_AsImplementationNamespaceProvider_ThenTheNamespaceIsAddedToTheList()
        {
            var settings = InjectionSettings
                           .WithInjectionMode(InjectionMode.Scoped)
                           .WithRootNamespaceOf(typeof(TestObjects.TestObject1))
                           .AllowImplementationsInAssemblyOf(typeof(TestObjects.Level2_2.TestObject2_2))
                           .WithInterfacePrefix("I")
                           .WithInterfaceSuffixes(new List <string> {
                "Repository", "Service"
            })
                           .WithStrictNaming();

            Assert.True(settings.InterfaceRootNamespaces.Count == 1);
            Assert.Equal(TestObjectRootNamespace, settings.AllowedImplementationNamespaces?.First());
        }