public void CancelEvent_When_executed_set_cancel_reason() { // Insert seed data into the database using one instance of the context InitializeCalendar(); LoadCalendar(); var reason = "snow"; var calendarId = 1; var note = "The schools are closed"; var repository = new CalendarRepository(_context); repository.CancelEvent(calendarId, reason, note); var calendar = _context.CalendarItems.Where(c => c.Id == calendarId).FirstOrDefaultAsync(); Assert.Equal(reason, calendar.Result.CancelReason); Assert.Equal(note, calendar.Result.Comments); }