コード例 #1
0
        public void CannotInsertIntoBuilderBeforeMissing()
        {
            TestCollectionBuilder builder = _composition.WithCollectionBuilder <TestCollectionBuilder>()
                                            .Append <Resolved1>();

            Assert.Throws <InvalidOperationException>(() =>
                                                      builder.InsertBefore <Resolved2, Resolved3>());
        }
コード例 #2
0
        public void CannotInsertIntoBuilderBeforeOnceCollectionIsCreated()
        {
            TestCollectionBuilder builder = _composition.WithCollectionBuilder <TestCollectionBuilder>()
                                            .Append <Resolved1>()
                                            .Append <Resolved2>();

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

            Assert.Throws <InvalidOperationException>(() =>
                                                      builder.InsertBefore <Resolved2, Resolved3>());
        }