Beispiel #1
0
        public async Task DeleteTestBaseByIdAsync_DeleteWithId1_DeletesItem()
        {
            var numberOfItemsInDatabase = await _context.TestBases.CountAsync();

            await _service.DeleteTestBaseByIdAsync(1);

            _context.TestBases.CountAsync().Result.Should().Be(numberOfItemsInDatabase - 1);
            _context.TestBases.FindAsync(1).Result.Should().BeNull();
        }
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            await _testBaseService.DeleteTestBaseByIdAsync(id);

            return(RedirectToAction(nameof(Index)));
        }