Esempio n. 1
0
        public void EditArticle()
        {
            //Arrange
            IArticleLogic logic         = LogicFactory.CreateArticleMemoryLogic();
            Article       article       = logic.GetCurrentArticle(3);
            Article       editedArticle = logic.GetCurrentArticle(2);

            article = logic.EditArticle(editedArticle);

            //Act
            Article expected = editedArticle;
            Article actual   = article;

            //Assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
 public ActionResult EditArticle(int articleId)
 {
     try
     {
         articleViewModel.Article = logic.GetCurrentArticle(articleId);
         return(View(articleViewModel));
     }
     catch (SqlException sqlException)
     {
         return(View("Error", sqlException));
     }
     catch (InvalidCastException invalidCastException)
     {
         return(View("Error", invalidCastException));
     }
 }
Esempio n. 3
0
        public void GetCurrentArticle()
        {
            //Arrange
            IArticleLogic logic   = LogicFactory.CreateArticleMemoryLogic();
            Article       article = logic.GetCurrentArticle(3);

            //Act
            int expected = 3;
            int actual   = article.ArticleId;

            //Assert
            Assert.AreEqual(expected, actual);
        }