Ejemplo n.º 1
0
        public MetasServiceTests()
        {
            _metaDataAccess.Setup(m => m.SaveAsync(It.IsAny <MetaData>(), It.IsAny <DataAccessActions>()))
            .Returns(Task.FromResult(_metaCounter))   //<-- returning the input value from task.
            .Callback(
                (MetaData m, DataAccessActions action) =>
            {
                if (action == DataAccessActions.Insert)
                {
                    _datas.Add(m);
                    _metaCounter++;
                }
                else if (action == DataAccessActions.Update)
                {
                }
                else
                {
                    // delete
                }
            });



            _metasService = new MetasService(new LoggerFactory(),
                                             _metaDataAccess.Object,
                                             new MetadataValidator());
        }
Ejemplo n.º 2
0
 public ContentsService(IViewService viewService, IMetasService metasService, IRepository <Contents> repository, IRelationshipService relationshipService, IMapper mapper)
 {
     _viewService         = viewService;
     _metasService        = metasService;
     _repository          = repository;
     _relationshipService = relationshipService;
     _mapper = mapper;
 }
Ejemplo n.º 3
0
 public InstallService(IOptionService optionService, IUserService userService, iBlogsContext blogsContext, ITransactionProvider transactionProvider, IContentsService contentsService, IMetasService metasService)
 {
     _optionService       = optionService;
     _userService         = userService;
     _blogsContext        = blogsContext;
     _transactionProvider = transactionProvider;
     _contentsService     = contentsService;
     _metasService        = metasService;
 }
Ejemplo n.º 4
0
 public ApiController(IMetasService metasService, ISiteService siteService, IContentsService contentsService, IUserService userService, IHostingEnvironment env, IAttachService attachService, IOptionService optionService)
 {
     _metasService    = metasService;
     _siteService     = siteService;
     _contentsService = contentsService;
     _userService     = userService;
     _env             = env;
     _attachService   = attachService;
     _optionService   = optionService;
 }
Ejemplo n.º 5
0
 public PagesService(ILoggerFactory loggerFactory,
                     IPagesDataAccess pageDataAccess,
                     IMetasService metaService,
                     IContentService contentService,
                     IValidator <Page> validator,
                     ISiteService siteService)
     : base(loggerFactory)
 {
     this._pageDataAccess = pageDataAccess;
     this._validator      = validator;
     this._metaService    = metaService;
     this._contentService = contentService;
     this._siteService    = siteService;
 }
Ejemplo n.º 6
0
        public BaseIntegrationTests()
        {
            Init();

            var loggerFactory = new LoggerFactory();

            // data access init
            _sitesDataAccess   = new SitesDataAccess(_configuration.GetConnectionString("default"), loggerFactory);
            _pageDataAccess    = new PagesDataAccess(_configuration.GetConnectionString("default"), loggerFactory);
            _contentDataAccess = new ContentsDataAccess(_configuration.GetConnectionString("default"), loggerFactory);
            _metasDataAccess   = new MetasDataAccess(_configuration.GetConnectionString("default"), loggerFactory);
            _menuDataAccess    = new MenusDataAccess(_configuration.GetConnectionString("default"), loggerFactory);


            _metasService   = new MetasService(loggerFactory, _metasDataAccess, new MetadataValidator());
            _contentService = new ContentService(loggerFactory, _contentDataAccess, new ContentValidator());
            _siteService    = new SitesService(loggerFactory,
                                               _sitesDataAccess,
                                               new SiteValidator());

            _pageService = new PagesService(loggerFactory,
                                            _pageDataAccess, _metasService, _contentService, new PageValidator(_pageDataAccess), _siteService);
        }
Ejemplo n.º 7
0
 public MetasApplication(IMetasService metasService)
 {
     _metasService = metasService;
 }
Ejemplo n.º 8
0
 public SiteService(IMetasService metasService)
 {
     _metasService = metasService;
 }