public void ManyResolverContainsTypes() { var resolver = new ManyResolver(new Type[] { typeof(Resolved1), typeof(Resolved2) }); Assert.IsTrue(resolver.ContainsType <Resolved1>()); Assert.IsTrue(resolver.ContainsType <Resolved2>()); Assert.IsFalse(resolver.ContainsType <Resolved3>()); //Assert.IsFalse(resolver.ContainsType<Resolved4>()); // does not compile }
public void ManyResolverCanClearBeforeFreeze() { var resolver = new ManyResolver(); resolver.AddType <Resolved1>(); resolver.AddType <Resolved2>(); resolver.Clear(); Assert.IsFalse(resolver.ContainsType <Resolved1>()); Assert.IsFalse(resolver.ContainsType <Resolved2>()); }
public void ManyResolverCanInsertBeforeTypeBeforeFreeze() { var resolver = new ManyResolver(new Type[] { typeof(Resolved1), typeof(Resolved2) }); resolver.InsertTypeBefore <Resolved2, Resolved3>(); Assert.IsTrue(resolver.ContainsType <Resolved1>()); Assert.IsTrue(resolver.ContainsType <Resolved2>()); Assert.IsTrue(resolver.ContainsType <Resolved3>()); }
public void ManyResolverCanClearBeforeFreeze() { var resolver = new ManyResolver(new ActivatorServiceProvider(), Mock.Of <ILogger>()); resolver.AddType <Resolved1>(); resolver.AddType <Resolved2>(); resolver.Clear(); Assert.IsFalse(resolver.ContainsType <Resolved1>()); Assert.IsFalse(resolver.ContainsType <Resolved2>()); }
public void ManyResolverCanInsertBeforeTypeBeforeFreeze() { var resolver = new ManyResolver(new ActivatorServiceProvider(), Mock.Of <ILogger>(), new Type[] { typeof(Resolved1), typeof(Resolved2) }); resolver.InsertTypeBefore <Resolved2, Resolved3>(); Assert.IsTrue(resolver.ContainsType <Resolved1>()); Assert.IsTrue(resolver.ContainsType <Resolved2>()); Assert.IsTrue(resolver.ContainsType <Resolved3>()); }
public void ManyResolverContainsTypes() { var resolver = new ManyResolver( new ActivatorServiceProvider(), Mock.Of <ILogger>(), new Type[] { typeof(Resolved1), typeof(Resolved2) }); Assert.IsTrue(resolver.ContainsType <Resolved1>()); Assert.IsTrue(resolver.ContainsType <Resolved2>()); Assert.IsFalse(resolver.ContainsType <Resolved3>()); //Assert.IsFalse(resolver.ContainsType<Resolved4>()); // does not compile }