Exemplo n.º 1
0
 private ArticlePictureUpdater CreateUpdater(
     IFileService fileService,
     IArticlePicturePathFormatter pathFormater,
     IEventHandler <ArticlePictureUpdated> handler)
 {
     return(new ArticlePictureUpdater(
                fileService,
                pathFormater,
                handler));
 }
Exemplo n.º 2
0
        private ArticlePictureUpdater CreateUpdater(
            IFileService fileService,
            IArticlePicturePathFormatter pathFormatter)
        {
            var handler = Substitute.For <IEventHandler <ArticlePictureUpdated> >();

            return(CreateUpdater(
                       fileService,
                       pathFormatter,
                       handler));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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;
        }