ArticleUpdaterService CreateService( IUpdateSourceValidator validator, IArticleProvider provider, IArticleStorageUpdater updater) { return(new ArticleUpdaterService( validator, provider, updater)); }
ArticleUpdaterService CreateService( IUpdateSourceValidator validator, IArticleStorageUpdater updater) { var stubProvider = Substitute.For <IArticleProvider>(); return(CreateService( validator, stubProvider, updater)); }
public void Constructor_NullUpdaterPassed_Throws() { var stubValidator = Substitute.For <IUpdateSourceValidator>(); var stubProvider = Substitute.For <IArticleProvider>(); IArticleStorageUpdater nullUpdater = null; Assert.Catch <ArgumentNullException>(() => new ArticleUpdaterService( stubValidator, stubProvider, nullUpdater)); }
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; }