public void AddServicesToDependencies() { var provider = new DependencyCollection() .AddServiceCollection(new ServiceCollection() .AddSingleton <JConverter>() .AddEmitter()) .BuildProvider(); provider.GetRequiredService <JConverter>(); provider.GetRequiredService <Emitter>(); }
public void Throw_Disposed() { var provider = new DependencyCollection() .AddSingleton <JConverter>() .BuildProvider(); provider.Dispose(); Assert.Throws <ObjectDisposedException>(() => provider.GetRequiredService <JConverter>()); }