Esempio n. 1
0
        public void RESTDubiousArticleGetByWrongId()
        {
            var controller = new DubiousArticleController(_dubiousArticleRepository, _logger, false);

            var data = controller.Get(40).Result;

            Assert.IsTrue(data is NotFoundResult);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }