Ejemplo n.º 1
0
 public ItemSearchFactory(
     ITemplateMapProvider templateMapProvider,
     ISearchResultsAdapter searchResultsAdapter)
 {
     TemplateMapProvider  = templateMapProvider;
     SearchResultsAdapter = searchResultsAdapter;
 }
Ejemplo n.º 2
0
 public void Initialise()
 {
     // Create mock objects
     _modelAssemblyProvider = new ModelAssemblyProvider();
     _templateMappingProvider = new TemplateMapProvider(_modelAssemblyProvider);
     _spawnProvider = new SpawnProvider(_templateMappingProvider);
 }
Ejemplo n.º 3
0
 public void Initialise()
 {
     // Create mock objects
     _modelAssemblyProvider   = new ModelAssemblyProvider();
     _templateMappingProvider = new TemplateMapProvider(_modelAssemblyProvider);
     _spawnProvider           = new SpawnProvider(_templateMappingProvider);
 }
Ejemplo n.º 4
0
 public void Initialise()
 {
     // Create mock objects
     _mockContextProvider     = new Mock <IContextProvider>();
     _modelAssemblyProvider   = new ModelAssemblyProvider();
     _templateMappingProvider = new TemplateMapProvider(_modelAssemblyProvider);
     _spawnProvider           = new SpawnProvider(_templateMappingProvider);
     _itemFactory             = new ItemFactory(_mockContextProvider.Object, _spawnProvider);
 }
Ejemplo n.º 5
0
        public static IQueryable <TSource> WhereTemplate <TSource>(this IQueryable <TSource> queryable, ITemplateMapProvider templateMapProvider)
            where TSource : IItemWrapper
        {
            var typeOfT = typeof(TSource);

            if (templateMapProvider.InterfaceTemplateMap.ContainsKey(typeOfT))
            {
                var templateId = templateMapProvider.InterfaceTemplateMap[typeOfT];

                queryable = queryable.Filter(item => item.TemplateIds.Contains(templateId));
            }

            return(queryable);
        }
Ejemplo n.º 6
0
 public SpawnProvider(ITemplateMapProvider templateMappingProvider)
 {
     _templateMapProvider = templateMappingProvider;
 }
Ejemplo n.º 7
0
 public void Initialise()
 {
     // Create mock objects
     _mockContextProvider = new Mock<IContextProvider>();
     _modelAssemblyProvider = new ModelAssemblyProvider();
     _templateMappingProvider = new TemplateMapProvider(_modelAssemblyProvider);
     _spawnProvider = new SpawnProvider(_templateMappingProvider);
     _itemFactory = new ItemFactory(_mockContextProvider.Object, _spawnProvider);
 }