public void AddBookReaderTest() { int beforeSize = context.bookReaders.Count; var beforeLastBookReader = context.bookReaders.Last(); var bookReaderToAdd = new BookReader() { Age = 35, FirstName = "Wiktor", LastName = "Forst", Telephone = "123456789" }; service.AddBookReader(bookReaderToAdd); int afterSize = context.bookReaders.Count; var afterLastBookReader = context.bookReaders.Last(); // check sizes Assert.AreNotEqual(beforeSize, afterSize); // check if last books aren't equal Assert.AreNotEqual(beforeLastBookReader, afterLastBookReader); // check if the book is in the list Assert.IsTrue(context.bookReaders.Contains(bookReaderToAdd)); }