Exemplo n.º 1
0
        public void Delete_ItemAlreadyDeleted_ExpectedResult_NotFound()
        {
            using (_context = new FwpsDbContext(_options))
            {
                _context.Database.EnsureCreated();
                _lc = new LightController(_context, _hub);

                _lc.Delete(1);

                IActionResult result = _lc.Delete(1);

                Assert.IsInstanceOf <NotFoundResult>(result);
            }
        }
Exemplo n.º 2
0
        public void Delete_SeveralDeletionsFromDatabase_ExpectedResult_NoItemsLeft()
        {
            using (_context = new FwpsDbContext(_options))
            {
                _context.Database.EnsureCreated();
                _lc = new LightController(_context, _hub);
                _lc.Create(_li);
                _lc.Create(_li2);

                _lc.Delete(1);
                _lc.Delete(2);
                _lc.Delete(3);

                Assert.That(_lc.GetAll().ToList().Count, Is.EqualTo(0));
            }
        }
Exemplo n.º 3
0
        public void Delete_OneItemInDatabase_ExpectedResult_NoItemsLeft()
        {
            using (_context = new FwpsDbContext(_options))
            {
                _context.Database.EnsureCreated();
                _lc = new LightController(_context, _hub);

                IActionResult result = _lc.Delete(1);

                Assert.That(_lc.GetAll().ToList().Count, Is.EqualTo(0));
            }
        }