public void ArticleServiceGetArticles() { // vezérlő példányosítása Service.Models.NewsService service = new Service.Models.NewsService(_entityMock.Object); // ellenőrzés januárra IEnumerable <Article> articles = service.Articles; Assert.AreEqual(1, articles.ToArray().Length); }
public void ArticleServiceGetWrongImage() { // vezérlő példányosítása Service.Models.NewsService service = new Service.Models.NewsService(_entityMock.Object); // ellenőrzés januárra Image image = service.GetImage(2); Assert.AreEqual(null, image); }
public void ArticleServiceGetArticle() { // vezérlő példányosítása Service.Models.NewsService service = new Service.Models.NewsService(_entityMock.Object); // ellenőrzés januárra Article article = service.GetArticle(1); Assert.AreEqual(1, article.Id); }
public void ArticleServiceDeleteArticle() { Service.Models.NewsService service = new Service.Models.NewsService(_entityMock.Object); Article article = _articleData[0]; Boolean result = service.DeleteArticle(article); Assert.AreEqual(true, result); Assert.AreEqual(0, _articleData.ToArray().Length); }
public void ArticleServiceAddArticle() { Service.Models.NewsService service = new Service.Models.NewsService(_entityMock.Object); Article article = new Article { Id = 2, Title = "TEST", Summary = "TEST", Content = "TEST", Author = "testadmin", PublishedAt = new DateTime(2017, 08, 06), isLead = false }; Boolean result = service.AddArticle(article); Assert.AreEqual(true, result); Assert.AreEqual(2, _articleData.ToArray().Length); }