public void UsingInitialImpl_resolves_impl_from_resolver(IResolver resolver, ServiceImpl1 impl) { var sut = new AutofacGenericDecoratorBuilder <IServiceInterface>(resolver); Mock.Get(resolver) .Setup(x => x.Resolve <ServiceImpl1>(It.IsAny <IEnumerable <Parameter> >())) .Returns(impl); var result = (AutofacGenericDecoratorCustomizer <IServiceInterface>)sut.UsingInitialImpl <ServiceImpl1>(); Assert.That(result?.Implementation, Is.SameAs(impl)); }
public void UsingInitialImpl_passes_params_to_resolver(IResolver resolver, ServiceImpl1 impl, Parameter[] parameters) { var sut = new AutofacGenericDecoratorBuilder <IServiceInterface>(resolver); Mock.Get(resolver) .Setup(x => x.Resolve <ServiceImpl1>(parameters)) .Returns(impl); var result = (AutofacGenericDecoratorCustomizer <IServiceInterface>)sut.UsingInitialImpl <ServiceImpl1>(parameters); Assert.That(result?.Implementation, Is.SameAs(impl)); }