private void BtnDelete_Click(object sender, EventArgs e) { TheaterDTO dto = lstTheaters.SelectedItem as TheaterDTO; bool result = _tc.DeleteTheater(dto); if (result) { MessageBox.Show("Salon başarıyla silindi."); } }
public void DeleteShouldDeleteTheater_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater("TEST", "Theater controller", "PUT", "UpdateTheater", "CA", "US", "1355"); theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var theaterController = new TheaterController(); // Act var actionResult = theaterController.DeleteTheater(theater); var response = actionResult as NegotiatedContentResult <String>; var content = response.Content; // Assert Assert.IsNotNull(response); Assert.IsNotNull(content); Assert.AreEqual((HttpStatusCode)200, response.StatusCode); }