public void CanClearBuilderBeforeCollectionIsCreated()
        {
            TestCollectionBuilder builder = _composition.WithCollectionBuilder <TestCollectionBuilder>()
                                            .Append <Resolved1>()
                                            .Append <Resolved2>();

            builder.Clear();
            Assert.IsFalse(builder.Has <Resolved1>());
            Assert.IsFalse(builder.Has <Resolved2>());

            IServiceProvider factory = _composition.CreateServiceProvider();
            TestCollection   col     = builder.CreateCollection(factory);

            AssertCollection(col);
        }
        public void CanAppendToBuilder()
        {
            TestCollectionBuilder builder = _composition.WithCollectionBuilder <TestCollectionBuilder>();

            builder.Append <Resolved1>();
            builder.Append <Resolved2>();

            Assert.IsTrue(builder.Has <Resolved1>());
            Assert.IsTrue(builder.Has <Resolved2>());
            Assert.IsFalse(builder.Has <Resolved3>());

            IServiceProvider factory = _composition.CreateServiceProvider();
            TestCollection   col     = builder.CreateCollection(factory);

            AssertCollection(col, typeof(Resolved1), typeof(Resolved2));
        }
        public void ContainsTypes()
        {
            TestCollectionBuilder builder = _composition.WithCollectionBuilder <TestCollectionBuilder>()
                                            .Append <Resolved1>()
                                            .Append <Resolved2>();

            Assert.IsTrue(builder.Has <Resolved1>());
            Assert.IsTrue(builder.Has <Resolved2>());
            Assert.IsFalse(builder.Has <Resolved3>());
            //// Assert.IsFalse(col.ContainsType<Resolved4>()); // does not compile

            IServiceProvider factory = _composition.CreateServiceProvider();
            TestCollection   col     = builder.CreateCollection(factory);

            AssertCollection(col, typeof(Resolved1), typeof(Resolved2));
        }
        public void CanInsertIntoBuilderAfterLast()
        {
            TestCollectionBuilder builder = _composition.WithCollectionBuilder <TestCollectionBuilder>()
                                            .Append <Resolved1>()
                                            .Append <Resolved2>()
                                            .InsertAfter <Resolved2, Resolved3>();

            Assert.IsTrue(builder.Has <Resolved1>());
            Assert.IsTrue(builder.Has <Resolved2>());
            Assert.IsTrue(builder.Has <Resolved3>());

            IServiceProvider factory = _composition.CreateServiceProvider();
            TestCollection   col     = builder.CreateCollection(factory);

            AssertCollection(col, typeof(Resolved1), typeof(Resolved2), typeof(Resolved3));
        }