Esempio n. 1
0
 public ArticleComparer(IArticleProvider articleProvider, ISimilarityCalculator similarityCalculator,
                        IArticleProcessor articleProcessor)
 {
     _articleProvider      = articleProvider;
     _similarityCalculator = similarityCalculator;
     _articleProcessor     = articleProcessor;
 }
Esempio n. 2
0
 public InventoryController(
     IInventoryProvider inventory,
     IArticleProvider article)
 {
     _inventory = inventory;
     _article   = article;
 }
Esempio n. 3
0
        public async Task WhenCalledProperlyReturnsAtMaxTenDocs(IArticleProvider articleProvider)
        {
            //Arrange
            articleService = contextSetter.SetContextProvider(articleProvider);
            //Action
            var result = await articleService.RetrieveArticles(search, startDate, endDate);

            //Assert
            Assert.True(result.Count() <= 10);
        }
Esempio n. 4
0
 ArticleUpdaterService CreateService(
     IUpdateSourceValidator validator,
     IArticleProvider provider,
     IArticleStorageUpdater updater)
 {
     return(new ArticleUpdaterService(
                validator,
                provider,
                updater));
 }
Esempio n. 5
0
 public InventoryController(
     IInventoryProvider inventoryProvider,
     IArticleProvider articleProvider,
     IStringLocalizer <SharedResource> localizer,
     IUserProvider <User> userProvider)
 {
     _inventoryProvider = inventoryProvider;
     _articleProvider   = articleProvider;
     _localizer         = localizer;
     _userProvider      = userProvider;
 }
Esempio n. 6
0
        public void Constructor_NullProviderPassed_Throws()
        {
            var stubValidator             = Substitute.For <IUpdateSourceValidator>();
            IArticleProvider nullProvider = null;
            var stubUpdater = Substitute.For <IArticleStorageUpdater>();

            Assert.Catch <ArgumentNullException>(() =>
                                                 new ArticleUpdaterService(
                                                     stubValidator,
                                                     nullProvider,
                                                     stubUpdater));
        }
Esempio n. 7
0
        public ArticleUpdaterService(
            IUpdateSourceValidator validator,
            IArticleProvider provider,
            IArticleStorageUpdater updater)
        {
            if (validator == null)
            {
                throw new ArgumentNullException(nameof(validator));
            }
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }
            if (updater == null)
            {
                throw new ArgumentNullException(nameof(updater));
            }

            this.validator = validator;
            this.provider  = provider;
            this.updater   = updater;
        }
Esempio n. 8
0
 //Forma 2
 public void SetContextProvider(IArticleService articleService, IArticleProvider provider)
 {
     articleService = new ArticleService(provider, validatorService);
 }
Esempio n. 9
0
 //Forma 1
 public ArticleService SetContextProvider(IArticleProvider provider)
 {
     this.articleService = new ArticleService(provider, validatorService);
     return(articleService);
 }
Esempio n. 10
0
 public ArticleListViewModel(IArticleProvider articleProvider)
 {
     Articles = new ObservableCollection <IArticle>(articleProvider.Get());
 }
Esempio n. 11
0
 public ArticleService(IArticleProvider articleProvider, IMapper mapper, MarkdownPipeline pipeline)
 {
     _articleProvider = articleProvider;
     _mapper          = mapper;
     _pipeline        = pipeline;
 }
Esempio n. 12
0
 public ArticleViewModelProvider(IArticleProvider articleProvider)
 {
     this.articleProvider = articleProvider;
 }
Esempio n. 13
0
 public MainWindowViewModel(IArticleProvider articleProvider)
 {
     //Articles = articleProvider.Get();
     IncrementCounterCommand = new DelegateCommand(IncrementCounter, () => Counter < 5)
                               .ObservesProperty(() => Counter);
 }
 public ArticleListingController(IArticleProvider newsarticleProvider)
 {
     _newsarticleProvider = newsarticleProvider ?? throw new ArgumentNullException(nameof(newsarticleProvider));
 }
Esempio n. 15
0
        //private readonly HttpClient _httpClient;

        //  public IArticleProvider ArticleProvider {get;set;}
        public ArticleService(IArticleProvider articleProvider, IValidatorService validatorService)
        {
            _articleProvider = articleProvider;
            // _httpClient = new HttpClient();
            _validatorService = validatorService;
        }
Esempio n. 16
0
 public ArticleController(IArticleProvider articleProvider, IStoreProvider storeProvider)
 {
     _articleProvider = articleProvider;
     _storeProvider   = storeProvider;
 }