public void AddServicesToDependencies()
        {
            var provider = new DependencyCollection()
                           .AddServiceCollection(new ServiceCollection()
                                                 .AddSingleton <JConverter>()
                                                 .AddEmitter())
                           .BuildProvider();

            provider.GetRequiredService <JConverter>();
            provider.GetRequiredService <Emitter>();
        }
Example #2
0
        public void Throw_Disposed()
        {
            var provider = new DependencyCollection()
                           .AddSingleton <JConverter>()
                           .BuildProvider();

            provider.Dispose();

            Assert.Throws <ObjectDisposedException>(() => provider.GetRequiredService <JConverter>());
        }