public void CannotInsertIntoBuilderBeforeMissing() { TestCollectionBuilder builder = _composition.WithCollectionBuilder <TestCollectionBuilder>() .Append <Resolved1>(); Assert.Throws <InvalidOperationException>(() => builder.InsertBefore <Resolved2, Resolved3>()); }
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>()); }