private ArticlePictureUpdater CreateUpdater( IFileService fileService, IArticlePicturePathFormatter pathFormater, IEventHandler <ArticlePictureUpdated> handler) { return(new ArticlePictureUpdater( fileService, pathFormater, handler)); }
private ArticlePictureUpdater CreateUpdater( IFileService fileService, IArticlePicturePathFormatter pathFormatter) { var handler = Substitute.For <IEventHandler <ArticlePictureUpdated> >(); return(CreateUpdater( fileService, pathFormatter, handler)); }
public void Constructor_NullFormatterPassed_Throws() { IFileService stubService = Substitute.For <IFileService>(); IArticlePicturePathFormatter nullFormater = null; var stubHandler = Substitute.For <IEventHandler <ArticlePictureUpdated> >(); var exception = Assert.Catch <ArgumentNullException>( () => new ArticlePictureUpdater( stubService, nullFormater, stubHandler)); }
public ArticlePictureUpdater( IFileService fileService, IArticlePicturePathFormatter formatter, IEventHandler <ArticlePictureUpdated> articlePictureUpdated) { if (fileService == null) { throw new ArgumentNullException(nameof(fileService)); } if (formatter == null) { throw new ArgumentNullException(nameof(formatter)); } if (articlePictureUpdated == null) { throw new ArgumentNullException(nameof(articlePictureUpdated)); } this.fileService = fileService; this.formatter = formatter; this.articlePictureUpdated = articlePictureUpdated; }