public void Delete_WhenRoomIdIsValid_ReturnViewRoom() { // Act var result = controller.Delete(2) as ViewResult; var booking = result.Model as Booking; var bookingId = booking.Id; // Assert Verify Assert.InRange <int>(bookingId, 1, 2); }
private void btn_delete_Click(object sender, EventArgs e) { Booking booking = (Booking)dgv_bookings.CurrentRow.DataBoundItem; bookingsController.Delete(booking.BookingId); dgv_bookings.ClearSelection(); dgv_bookings.DataSource = bookingsController.GetBookingsByEmployee((Employee)cb_employee.SelectedItem, dateTime1.SelectionStart); if (dgv_bookings.Rows.Count <= 0) { lb_Services.DataSource = null; lb_Products.DataSource = null; } }
public void Delete() { var controller = new BookingsController(_bookingService); controller.Delete(0); }