public void AssignBook_Should_Not_Add_BookAssignment_For_Assigned_Book() { var dbContext = new EntityDbContext(); var bookManger = new BookManager(dbContext); bookManger.AssignBook( new AssignBookCriteriaDto { BookId = 2, StudentId = 3 }); }
public void AssignBook_Should_Add_BookAssignment() { var dbContext = new EntityDbContext(); var bookManger = new BookManager(dbContext); int existingBookAssignmentsCount = dbContext.BookAssignments.Count; bookManger.AssignBook( new AssignBookCriteriaDto { BookId = 3, StudentId = 3 }); Assert.AreEqual(existingBookAssignmentsCount + 1, dbContext.BookAssignments.Count); }