public void GetAllArticles() { //Arrange IArticleLogic logic = LogicFactory.CreateArticleMemoryLogic(); List <Article> AllArticles = logic.GetAllArticles(); //Act int expected = 2; int actual = AllArticles.Count(); //Assert Assert.AreEqual(expected, actual); }
public ActionResult Index() { try { articleViewModel.Articles = logic.GetAllArticles(); return(View(articleViewModel)); } catch (SqlException sqlException) { return(View("Error", sqlException)); } catch (InvalidCastException invalidCastException) { return(View("Error", invalidCastException)); } }