public void ShouldSetArticleActive()
        {
            PopulateRepository();

            SetActiveArticleCommand command = new SetActiveArticleCommand
            {
                ArticleId = new Guid("4aeabf09-da78-4fcd-bb73-667605871a5e")
            };

            applicationService.SetActive(command);

            Article article = applicationService.GetById(new Guid("4aeabf09-da78-4fcd-bb73-667605871a5e"));

            Assert.IsTrue(article.Active);
        }
Ejemplo n.º 2
0
        public void SetActive(SetActiveArticleCommand command)
        {
            command.Validate();

            if (AddNotifications(command))
            {
                return;
            }

            Article article = _articleRepository.GetById(command.ArticleId);

            if (NotifyNullArticle(article))
            {
                return;
            }

            article.SetActive();

            _articleRepository.Update(article);

            Commit();
        }