Exemplo n.º 1
0
 public ScopeTests(ITestOutputHelper output) : base(output)
 {
     _dependencies = new DependencyCollection()
                     .AddSingleton <IConfiguration>(ctx => new Configuration())
                     .AddSingleton <JConverter>();
 }
Exemplo n.º 2
0
        public void Throw_Activate_Interface()
        {
            var provider = new DependencyCollection().BuildProvider();

            Assert.Throws <InvalidOperationException>(() => provider.Activate <ISession>());
        }
Exemplo n.º 3
0
        public void Throw_Activate_NotRegistered()
        {
            var provider = new DependencyCollection().BuildProvider();

            Assert.Throws <KeyNotFoundException>(() => provider.Activate <FooRepository>());
        }
Exemplo n.º 4
0
 public static DependencyCollection AddPool <T>(this DependencyCollection dependencies, T[] buffer)
     where T : class
 {
     dependencies.AddInstance <IPool <T> >(new Pool <T>(buffer));
     return(dependencies);
 }