public void Container_Service_ShouldBeNullChecked() { Assert.Throws <ArgumentNullException>(() => IServiceContainerBasicExtensions.Service(null, typeof(IDisposable), typeof(Disposable), Lifetime.Transient)); Assert.Throws <ArgumentNullException>(() => Container.Service(null, typeof(Disposable), Lifetime.Transient)); Assert.Throws <ArgumentNullException>(() => Container.Service(typeof(IDisposable), null, Lifetime.Transient)); Assert.Throws <ArgumentNullException>(() => Container.Service(typeof(IDisposable), typeof(Disposable), null)); }
public void Container_Factory_ShouldBeNullChecked() { Assert.Throws <ArgumentNullException>(() => IServiceContainerBasicExtensions.Factory(null, typeof(IDisposable), (i, t) => new Disposable(), Lifetime.Transient)); Assert.Throws <ArgumentNullException>(() => Container.Factory(null, (i, t) => new Disposable(), Lifetime.Transient)); Assert.Throws <ArgumentNullException>(() => Container.Factory(typeof(IDisposable), null, Lifetime.Transient)); Assert.Throws <ArgumentNullException>(() => Container.Factory(typeof(IDisposable), (i, t) => new Disposable(), null)); }
public void Container_Proxy_ShouldBeNullChecked() { Assert.Throws <ArgumentNullException>(() => IServiceContainerAdvancedExtensions.Proxy(null, typeof(IDisposable), null, typeof(InterfaceInterceptor <IDisposable>))); Assert.Throws <ArgumentNullException>(() => Container.Proxy(null, null, typeof(InterfaceInterceptor <IDisposable>))); //Assert.Throws<ArgumentNullException>(() => Container.Proxy(typeof(IDisposable), null, (Type) null)); Assert.Throws <ArgumentNullException>(() => IServiceContainerBasicExtensions.Proxy(null, typeof(IDisposable), null, (i, t, o) => o)); Assert.Throws <ArgumentNullException>(() => Container.Proxy(null, null, (i, t, o) => o)); //Assert.Throws<ArgumentNullException>(() => Container.Proxy(typeof(IDisposable), null, (Func<IInjector, Type, object, object>) null)); }
public void Container_Instance_ShouldBeNullChecked() { Assert.Throws <ArgumentNullException>(() => IServiceContainerBasicExtensions.Instance(null, typeof(IDisposable), new Disposable())); //Assert.Throws<ArgumentNullException>(() => Container.Instance(null, new Disposable())); Assert.Throws <ArgumentNullException>(() => Container.Instance <IDisposable>(null)); }
public void Container_Abstract_ShouldBeNullChecked() { Assert.Throws <ArgumentNullException>(() => IServiceContainerBasicExtensions.Abstract(null, typeof(IDisposable))); Assert.Throws <ArgumentNullException>(() => Container.Abstract(null)); }