public void RESTDubiousArticleGetByWrongId() { var controller = new DubiousArticleController(_dubiousArticleRepository, _logger, false); var data = controller.Get(40).Result; Assert.IsTrue(data is NotFoundResult); }
public void RESTDubiousArticleGetAllValues() { var controller = new DubiousArticleController(_dubiousArticleRepository, _logger, false); var result = controller.Get().Result; var okResult = result as OkObjectResult; var data = okResult.Value as IEnumerable <dubious_article>; var test = data.ToList(); Assert.AreEqual(0, test.Count); }
public void RESTDubiousArticleDelete() { var logger = new LogRepository(_context, _mapper, _logger); var repo = new DubiousArticleRepository(_context, _mapper, logger, _logger); var controller = new DubiousArticleController(repo, _logger, false); controller.DeleteAll().Wait(); var test = repo.Get().Result.ToList(); Assert.IsNotNull(test); Assert.AreEqual(0, test.Count); }