public void EditBook_CorrectData_TrueReturned() { //Arrange //Arrange string author = "Джорджи Кроули"; int field_knowledge_id = 34; string name = "Корги по имени Генри"; string isbn = "978-5-386-12347-5"; string place = "Москва"; int year = 1755; int interpreter_id = 2; int chamber_id = 2; string newName = "Аываы"; //Act List <books> updatingClient = new List <books>(); if (booksController.AddNewBook(author, field_knowledge_id, name, isbn, place, year, interpreter_id, chamber_id)) { int tradingId = dbHelper.context.books.OrderByDescending(t => t.book_id).FirstOrDefault().book_id; updatingClient = booksController.GetBookId(tradingId); if (booksController.UpdateBookInfo(author, field_knowledge_id, newName, isbn, place, year, interpreter_id, chamber_id, updatingClient)) { dbHelper = new DbHelper(); string expectedName = dbHelper.context.books.Where(t => t.name == newName).FirstOrDefault().name; var selectString = dbHelper.context.books.AsNoTracking().OrderByDescending(t => t.book_id).Take(1); foreach (var item in selectString) { booksController.DeleteBookInfo(item); } //Assert Assert.AreEqual(expectedName, newName); } } }