public async Task TestDeleteWord() { using (var context = new bookAPIContext(options)) { WordsController wordsController = new WordsController(context); ActionResult <Word> result = await wordsController.DeleteWord(words[0].WordId); Assert.IsNotNull(result); // not use Assert.AreEqual(4,words.Count); Words.Count will always be 3 whereas context.Word.Count() will check length of db of the context Assert.AreEqual(context.Word.Count(), 2); } }