예제 #1
0
 protected override void ScenarioSetup()
 {
     ConverterProvider.Setup(instance => instance.FindConverter(It.IsAny <Type>())).Returns(new TestConverter());
     EntityMappingProvider = SetupMappingProviders(typeof(IProductOffering <>), "Offerring", "Image", "OfferedProduct", "Texts").ToList();
     MappingProviderVisitor.Setup(instance => instance.Visit(It.IsAny <ICollectionMappingProvider>()));
     MappingProviderVisitor.Setup(instance => instance.Visit(It.IsAny <IPropertyMappingProvider>()));
     MappingProviderVisitor.Setup(instance => instance.Visit(It.IsAny <IEntityMappingProvider>()));
     MappingSource.Setup(instance => instance.GatherEntityMappingProviders())
     .Returns(EntityMappingProvider.Select(provider => provider.Object));
     Mappings = Builder.BuildMappings(new[] { MappingSource.Object }, OpenGenericMappingProviders = new Dictionary <Type, ICollection <ITermMappingProvider> >());
 }
 protected override void ScenarioSetup()
 {
     ConverterProvider.Setup(instance => instance.FindConverter(It.IsAny <Type>())).Returns(new TestConverter());
     PrimaryEntityMappingProvider   = SetupMappingProviders <IProduct>("Product", "Name", "Price").ToList();
     SecondaryEntityMappingProvider = SetupMappingProviders <IProduct>("Service", "Description", "Name").ToList();
     MappingProviderVisitor.Setup(instance => instance.Visit(It.IsAny <ICollectionMappingProvider>()));
     MappingProviderVisitor.Setup(instance => instance.Visit(It.IsAny <IPropertyMappingProvider>()));
     MappingProviderVisitor.Setup(instance => instance.Visit(It.IsAny <IEntityMappingProvider>()));
     MappingSource.Setup(instance => instance.GatherEntityMappingProviders())
     .Returns(PrimaryEntityMappingProvider.Concat(SecondaryEntityMappingProvider).Select(provider => provider.Object));
 }