public void WhenResolvingSVsServiceProviderImportInVS_ThenSucceeds() { var composition = this.serviceProvider.GetService <IBindingCompositionService>(); var result = new ServicedClass(); composition.SatisfyImportsOnce(result); }
public void WhenResolvingDynamicBindingContxtImport_ThenSucceeds() { var composition = this.serviceProvider.GetService <IBindingCompositionService>(); var context = composition.CreateDynamicContext(); var result = new ServicedClass(); context.CompositionService.SatisfyImportsOnce(result); Assert.NotNull(result.Context); }
public void WhenResolvingSVsServiceProviderImport_ThenSucceeds() { var components = new Mock <IComponentModel> { DefaultValue = DefaultValue.Mock }; components.As <SComponentModel>(); var services = new Mock <IServiceProvider> { DefaultValue = DefaultValue.Mock }; services.As <SVsServiceProvider>(); services.Setup(x => x.GetService(typeof(SComponentModel))).Returns(components.Object); var composition = new BindingCompositionService(services.Object); var result = new ServicedClass(); composition.SatisfyImportsOnce(result); }
public void WhenResolvingSVsServiceProviderImport_ThenSucceeds() { var components = new Mock<IComponentModel> { DefaultValue = DefaultValue.Mock }; components.As<SComponentModel>(); var services = new Mock<IServiceProvider> { DefaultValue = DefaultValue.Mock }; services.As<SVsServiceProvider>(); services.Setup(x => x.GetService(typeof(SComponentModel))).Returns(components.Object); var composition = new BindingCompositionService(services.Object); var result = new ServicedClass(); composition.SatisfyImportsOnce(result); }
public void WhenResolvingDynamicBindingContxtImport_ThenSucceeds() { var composition = this.serviceProvider.GetService<IBindingCompositionService>(); var context = composition.CreateDynamicContext(); var result = new ServicedClass(); context.CompositionService.SatisfyImportsOnce(result); Assert.NotNull(result.Context); }
public void WhenResolvingSVsServiceProviderImportInVS_ThenSucceeds() { var composition = this.serviceProvider.GetService<IBindingCompositionService>(); var result = new ServicedClass(); composition.SatisfyImportsOnce(result); }