public void ProductionService_CreateProductionDateTime_Pass() { //Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater("The Magicians", "Regal", "theater st", "LA", "CA", "US", "323323"); theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var productionName = "The Lion King"; var directorFirstName = "Joan"; var directorLastName = "Doe"; var street = "123 Anahiem St"; var city = "Long Beach"; var stateProvince = "California"; var country = "United States"; var zipcode = "919293"; var production = new Production(theater.TheaterID, productionName, directorFirstName, directorLastName, street, city, stateProvince, country, zipcode); productionService.CreateProduction(production); dbcontext.SaveChanges(); var date = DateTime.Parse("3/23/2019 3:22:29 PM"); var time = TimeSpan.Parse("10:30:00"); /* Info: Had to cast to int because in production entity model int was made into a Nullable<int> or int? for data validation purposes * If we make model in frontend then we can remove this cast to int and it will make things cleaner */ var productionDateTime = new ProductionDateTime((int)production.ProductionID, date, time); var expected = true; var actual = false; // Act productionService.CreateProductionDateTime(productionDateTime); dbcontext.SaveChanges(); if (productionDateTime.ProductionDateTimeId > 0) { actual = true; } // Assert productionService.DeleteProduction(production); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); Assert.AreEqual(expected, actual); }
public void ProductionService_UpdateProduction_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater("The Magicians", "Regal", "theater st", "LA", "CA", "US", "323323"); theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var productionName = "The Lion King"; var directorFirstName = "Joan"; var directorLastName = "Doe"; var street = "123 Anahiem St"; var city = "Long Beach"; var stateProvince = "California"; var country = "United States"; var zipcode = "919293"; var production = new Production(theater.TheaterID, productionName, directorFirstName, directorLastName, street, city, stateProvince, country, zipcode); productionService.CreateProduction(production); dbcontext.SaveChanges(); production.ProductionName = "The Lion King 2"; production.StateProvince = "Utah"; production.DirectorLastName = "Mangos"; var expected = new List <string>() { "The Lion King 2", "Utah", "Mangos" }; // Act var actual = productionService.UpdateProduction(production); dbcontext.SaveChanges(); // Assert productionService.DeleteProduction(production); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); Assert.AreEqual(expected[0], actual.ProductionName); Assert.AreEqual(expected[1], actual.StateProvince); Assert.AreEqual(expected[2], actual.DirectorLastName); }
public void ProductionService_CreateProduction_Pass() { var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); // Arrange var theater = new Theater("someTheater", "Regal", "theater st", "LA", "CA", "US", "323323"); theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionName = "The Lion King"; var directorFirstName = "Jane"; var directorLastName = "Doe"; var street = "Anahiem"; var city = "Long Beach"; var stateProvince = "California"; var country = "United States"; var zipcode = "919293"; var production = new Production(theater.TheaterID, productionName, directorFirstName, directorLastName, street, city, stateProvince, country, zipcode); var expected = true; var actual = false; var productionService = new ProductionService(dbcontext); // Act productionService.CreateProduction(production); dbcontext.SaveChanges(); if (production.ProductionID > 0) { actual = true; } // Assert var dbcontext_ = new BroadwayBuilderContext(); var productionService_ = new ProductionService(dbcontext_); productionService.DeleteProduction(production); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); Assert.AreEqual(expected, actual); }
public void ProductionService_GetProductionById_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater("The Language", "Pantene", "123 Sesame St", "San Diego", "California", "U.S", "8587175730"); theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var production = new Production { ProductionName = "The Pajama Game", DirectorFirstName = "Doris", DirectorLastName = "Day", City = "San Diego", StateProvince = "California", Country = "U.S", TheaterID = theater.TheaterID, Street = "123 Sesame St", Zipcode = "91911" }; productionService.CreateProduction(production); dbcontext.SaveChanges(); var expected = true; var actual = false; // Act var readProduction = productionService.GetProduction(production.ProductionID); if (readProduction != null) { actual = true; } // Assert Assert.AreEqual(expected, actual); }
public IHttpActionResult CreateProduction([FromBody] Production production) { using (var dbcontext = new BroadwayBuilderContext()) { var productionService = new ProductionService(dbcontext); try { productionService.CreateProduction(production); dbcontext.SaveChanges(); // Todo: Turn this into Created(201) once the get endpoint is done so we can return the url to get the item that was just created return(Ok("production created")); } // Todo: add proper error handling catch (Exception e) { return(BadRequest()); } } }
public void ProductionJobService_ReadProductionJobPosting_Pass() { //Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var productionService = new ProductionService(dbcontext); var productionJobService = new ProductionJobService(dbcontext); var expected = true; var actual = false; var theater = new Theater("someTheater", "Regal", "theater st", "LA", "CA", "US", "323323"); var production = new Production(theater.TheaterID, "someName", "directorln", "directorfn", "street", "city", "state", "country", "zip"); theaterService.CreateTheater(theater); productionService.CreateProduction(production); dbcontext.SaveChanges(); /* Info: Had to cast to int because in production entity model int was made into a Nullable<int> or int? for data validation purposes * If we make model in frontend then we can remove this cast to int and it will make things cleaner */ var jobPosting = new ProductionJobPosting((int)production.ProductionID, "intern", "some decription", "title", "hours", "some requirements"); //Act productionJobService.CreateProductionJob(jobPosting); dbcontext.SaveChanges(); ProductionJobPosting productionJobPost = productionJobService.GetProductionJob(jobPosting); if (productionJobPost != null) { actual = true; } productionJobService.DeleteProductionJob(jobPosting); productionService.DeleteProduction(production); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); //Assert Assert.AreEqual(expected, actual); }
public IHttpActionResult CreateProduction([FromBody] Production production) { try { using (var dbcontext = new BroadwayBuilderContext()) { var productionService = new ProductionService(dbcontext); productionService.CreateProduction(production); dbcontext.SaveChanges(); var productionUrl = Url.Link("GetProductionById", new { productionId = production.ProductionID }); return(Created(productionUrl, new ProductionResponseModel() { ProductionID = production.ProductionID, DirectorFirstName = production.DirectorFirstName, DirectorLastName = production.DirectorLastName, ProductionName = production.ProductionName, Street = production.Street, City = production.City, StateProvince = production.StateProvince, Country = production.Country, TheaterID = production.TheaterID })); } } catch (DbUpdateException e) { return(Content((HttpStatusCode)500, e.Message)); } // Todo: add proper error handling catch (Exception e) { return(BadRequest(e.Message)); } }
public void ProductionService_SavePhotos_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater() { TheaterName = "Some Theater 1", StreetAddress = "Theater St", State = "CA", City = "LA", CompanyName = "Regal", Country = "US", PhoneNumber = "123456789" }; theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var production = new Production() { ProductionName = "The Lion King 2", DirectorFirstName = "Jane", DirectorLastName = "Doe", Street = "Anahiem", City = "Long Beach", StateProvince = "California", Country = "United States", Zipcode = "919293", TheaterID = theater.TheaterID }; var productionService = new ProductionService(dbcontext); productionService.CreateProduction(production); dbcontext.SaveChanges(); var mockedPostedPdfFile = new MockPostedFile("jpg", 5000000, "productionPhotoTestFile.jpg"); var extension = Path.GetExtension(mockedPostedPdfFile.FileName); var currentDirectory = ConfigurationManager.AppSettings["FileDir"]; var dir = Path.Combine(currentDirectory, "Photos/"); var subdir = Path.Combine(dir, $"Production{production.ProductionID}/"); var filePath = Path.Combine(subdir, $"{production.ProductionID}-0{extension}"); var expected = true; var actual = false; // Act productionService.SavePhoto(production.ProductionID, mockedPostedPdfFile); if (File.Exists(filePath)) { actual = true; } // Assert productionService.DeleteProduction(production.ProductionID); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); File.Delete(filePath); Directory.Delete(subdir); Assert.AreEqual(expected, actual); }
public void ProductionService_DeleteProductionDateTime_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater() { TheaterName = "The Magicians", StreetAddress = "Pantene", State = "CA", City = "LA", CompanyName = "123 Sesame St", Country = "US", PhoneNumber = "123456789" }; theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var production = new Production { ProductionName = "The Pajama Game 1", DirectorFirstName = "Doris", DirectorLastName = "Day", City = "San Diego", StateProvince = "California", Country = "U.S", TheaterID = theater.TheaterID, Street = "1234 Sesame St", Zipcode = "91911" }; productionService.CreateProduction(production); dbcontext.SaveChanges(); var date = DateTime.Parse("3/28/2019 3:22:29 PM"); var time = TimeSpan.Parse("11:30:00"); var productionDateTime = new ProductionDateTime(production.ProductionID, date, time); productionService.CreateProductionDateTime(production.ProductionID, productionDateTime); dbcontext.SaveChanges(); var expected = true; var actual = false; // Act productionService.DeleteProductionDateTime(productionDateTime); var affectedRows = dbcontext.SaveChanges(); if (affectedRows > 0) { actual = true; } // Assert productionService.DeleteProduction(production.ProductionID); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); Assert.AreEqual(expected, actual); }
public void ProductionService_UpdateProduction_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater() { TheaterName = "The Magicians", StreetAddress = "Pantene", State = "CA", City = "LA", CompanyName = "123 Sesame St", Country = "US", PhoneNumber = "123456789" }; theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var production = new Production() { ProductionName = "The Lion King", DirectorFirstName = "Jane", DirectorLastName = "Doe", Street = "Anahiem", City = "Long Beach", StateProvince = "California", Country = "United States", Zipcode = "919293", TheaterID = theater.TheaterID }; productionService.CreateProduction(production); dbcontext.SaveChanges(); production.ProductionName = "The Lion King 2"; production.StateProvince = "Utah"; production.DirectorLastName = "Mangos"; var expected = new List <string>() { "The Lion King 2", "Utah", "Mangos" }; // Act var actual = productionService.UpdateProduction(production); dbcontext.SaveChanges(); // Assert productionService.DeleteProduction(production.ProductionID); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); Assert.AreEqual(expected[0], actual.ProductionName); Assert.AreEqual(expected[1], actual.StateProvince); Assert.AreEqual(expected[2], actual.DirectorLastName); }
public void ProductionService_GetProductionsByCurrentDate_Pass() { // Arrange // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater() { TheaterName = "The Language", StreetAddress = "Pantene", State = "CA", City = "LA", CompanyName = "123 Sesame St", Country = "US", PhoneNumber = "123456789" }; theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var production1 = new Production() { ProductionName = "The Lion King 14", DirectorFirstName = "Joan", DirectorLastName = "Doe", Street = "123 Anahiem St", City = "Long Beach", StateProvince = "California", Country = "United States", Zipcode = "919293", TheaterID = theater.TheaterID }; productionService.CreateProduction(production1); dbcontext.SaveChanges(); var production2 = new Production() { ProductionName = "The Lion King 15", DirectorFirstName = "Joan", DirectorLastName = "Doe", Street = "123 Anahiem St", City = "Long Beach", StateProvince = "California", Country = "United States", Zipcode = "919293", TheaterID = theater.TheaterID }; productionService.CreateProduction(production2); dbcontext.SaveChanges(); var productionDateTime1 = new ProductionDateTime() { Date = DateTime.Parse("3/23/2019 3:22:29 PM"), Time = TimeSpan.Parse("10:30:00"), ProductionID = production1.ProductionID }; productionService.CreateProductionDateTime(production1.ProductionID, productionDateTime1); dbcontext.SaveChanges(); var productionDateTime2 = new ProductionDateTime() { Date = DateTime.Parse("3/29/2019 3:22:29 PM"), Time = TimeSpan.Parse("5:30:00"), ProductionID = production2.ProductionID }; productionService.CreateProductionDateTime(production2.ProductionID, productionDateTime2); dbcontext.SaveChanges(); var expected = true; var actual = false; // Act var readProductionsList = productionService.GetProductionsByCurrentAndFutureDate(new DateTime(2019, 3, 1), null, 1, 10); // Theater id is meant to be null if (readProductionsList != null) { actual = true; } // Assert productionService.DeleteProductionDateTime(productionDateTime2); dbcontext.SaveChanges(); productionService.DeleteProductionDateTime(productionDateTime1); dbcontext.SaveChanges(); productionService.DeleteProduction(production1.ProductionID); dbcontext.SaveChanges(); productionService.DeleteProduction(production2.ProductionID); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); Assert.AreEqual(expected, actual); }
public void ProductionController_GetPhotos_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater() { TheaterName = "Some Theater", StreetAddress = "Theater St", State = "CA", City = "LA", CompanyName = "Regal", Country = "US", PhoneNumber = "123456789" }; theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var production = new Production { ProductionName = "The Pajama Game", DirectorFirstName = "Doris", DirectorLastName = "Day", City = "San Diego", StateProvince = "California", Country = "U.S", TheaterID = theater.TheaterID, Street = "123 Sesame St", Zipcode = "91911" }; productionService.CreateProduction(production); dbcontext.SaveChanges(); var productionController = new ProductionController(); var mockPostedPdfFile1 = new MockPostedFile("jpg", 5000000, "1.jpg"); var mockPostedPdfFile2 = new MockPostedFile("jpg", 5000000, "2.jpg"); productionService.SavePhoto(production.ProductionID, mockPostedPdfFile1); productionService.SavePhoto(production.ProductionID, mockPostedPdfFile2); var currentDirectory = ConfigurationManager.AppSettings["FileDir"]; var dir = Path.Combine(currentDirectory, "Photos/"); var subdir = Path.Combine(dir, $"Production{production.ProductionID}/"); // Act var actionResult = productionController.GetPhotos(production.ProductionID); // Need access to contet of the response var response = actionResult as OkNegotiatedContentResult <List <string> >; var photoUrls = response.Content; var expected = true; var actual = false; if (photoUrls.Count == 2) { actual = true; } productionService.DeleteProduction(production.ProductionID); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); Directory.Delete(subdir, true); // Assert Assert.IsNotNull(response); Assert.AreEqual(expected, actual); }
public void ProductionController_DeleteProductionDateTime_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater() { TheaterName = "The Magicians", StreetAddress = "Pantene", State = "CA", City = "LA", CompanyName = "123 Sesame St", Country = "US", PhoneNumber = "123456789" }; theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var production = new Production { ProductionName = "The Pajama Game 1", DirectorFirstName = "Doris", DirectorLastName = "Day", City = "San Diego", StateProvince = "California", Country = "U.S", TheaterID = theater.TheaterID, Street = "1234 Sesame St", Zipcode = "91911" }; productionService.CreateProduction(production); dbcontext.SaveChanges(); var date = DateTime.Parse("3/28/2019 3:22:29 PM"); var time = TimeSpan.Parse("11:30:00"); var productionDateTime = new ProductionDateTime(production.ProductionID, date, time); productionService.CreateProductionDateTime(production.ProductionID, productionDateTime); dbcontext.SaveChanges(); var productionController = new ProductionController(); // Act var actionResult = productionController.deleteProductiondateTime(productionDateTime.ProductionDateTimeId, productionDateTime); var response = actionResult as OkNegotiatedContentResult <string>; var dbcontext_ = new BroadwayBuilderContext(); var theaterService_ = new TheaterService(dbcontext_); var theater_ = theaterService.GetTheaterByID(theater.TheaterID); theaterService_.DeleteTheater(theater_); dbcontext_.SaveChanges(); // Assert Assert.IsNotNull(response); Assert.AreEqual("Production date time deleted succesfully!", response.Content); }
public void ProductionController_UpdateProductionDateTime_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater() { TheaterName = "The Magicians", StreetAddress = "Pantene", State = "CA", City = "LA", CompanyName = "123 Sesame St", Country = "US", PhoneNumber = "123456789" }; theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var production = new Production { ProductionName = "The Pajama Game 1", DirectorFirstName = "Doris", DirectorLastName = "Day", City = "San Diego", StateProvince = "California", Country = "U.S", TheaterID = theater.TheaterID, Street = "1234 Sesame St", Zipcode = "91911" }; productionService.CreateProduction(production); dbcontext.SaveChanges(); var date = DateTime.Parse("3/28/2019 3:22:29 PM"); var time = TimeSpan.Parse("11:30:00"); var productionDateTime = new ProductionDateTime(production.ProductionID, date, time); productionService.CreateProductionDateTime(production.ProductionID, productionDateTime); dbcontext.SaveChanges(); productionDateTime.Date = DateTime.Parse("3/27/2019 3:22:29 PM"); productionDateTime.Time = TimeSpan.Parse("9:30:00"); var productionController = new ProductionController(); // Act var actionResult = productionController.updateProductionDateTime(productionDateTime.ProductionDateTimeId, productionDateTime); var response = actionResult as OkNegotiatedContentResult <ProductionDateTime>; var updatedProductionDateTime = response.Content; var expected = new { DateTime = DateTime.Parse("3/27/2019 3:22:29 PM"), TimeSpan = TimeSpan.Parse("9:30:00") }; var actual = updatedProductionDateTime; productionService.DeleteProductionDateTime(productionDateTime); dbcontext.SaveChanges(); productionService.DeleteProduction(response.Content.ProductionID); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); // Assert Assert.IsNotNull(response); Assert.AreEqual(productionDateTime.ProductionDateTimeId, updatedProductionDateTime.ProductionDateTimeId); Assert.AreEqual(expected.DateTime, actual.Date); Assert.AreEqual(expected.TimeSpan, actual.Time); }
public void ProductionController_UpdateProduction_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater() { TheaterName = "The Magicians", StreetAddress = "Pantene", State = "CA", City = "LA", CompanyName = "123 Sesame St", Country = "US", PhoneNumber = "123456789" }; theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var production = new Production() { ProductionName = "The Lion King", DirectorFirstName = "Jane", DirectorLastName = "Doe", Street = "Anahiem", City = "Long Beach", StateProvince = "California", Country = "United States", Zipcode = "919293", TheaterID = theater.TheaterID }; production.ProductionName = "The Updated Lion King"; production.StateProvince = "Utah"; production.DirectorLastName = "Mangos"; productionService.CreateProduction(production); dbcontext.SaveChanges(); var productionController = new ProductionController(); // Act var actionResult = productionController.UpdateProduction(production); var response = actionResult as OkNegotiatedContentResult <Production>; var updatedProduction = response.Content; productionService.DeleteProduction(response.Content.ProductionID); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); // Assert Assert.IsNotNull(response); Assert.AreEqual(production.ProductionID, updatedProduction.ProductionID); Assert.AreEqual("The Updated Lion King", updatedProduction.ProductionName); Assert.AreEqual("Utah", updatedProduction.StateProvince); Assert.AreEqual("Mangos", updatedProduction.DirectorLastName); }
public void ProductionController_GetProductions_Pass() { // Arrange var dbcontext = new BroadwayBuilderContext(); var theaterService = new TheaterService(dbcontext); var theater = new Theater() { TheaterName = "Some Theater", StreetAddress = "Theater St", State = "CA", City = "LA", CompanyName = "Regal", Country = "US", PhoneNumber = "123456789" }; theaterService.CreateTheater(theater); dbcontext.SaveChanges(); var productionService = new ProductionService(dbcontext); var production1 = new Production() { ProductionName = "The Lion King 14", DirectorFirstName = "Joan", DirectorLastName = "Doe", Street = "123 Anahiem St", City = "Long Beach", StateProvince = "California", Country = "United States", Zipcode = "919293", TheaterID = theater.TheaterID }; productionService.CreateProduction(production1); dbcontext.SaveChanges(); var production2 = new Production() { ProductionName = "The Lion King 15", DirectorFirstName = "Joan", DirectorLastName = "Doe", Street = "123 Anahiem St", City = "Long Beach", StateProvince = "California", Country = "United States", Zipcode = "919293", TheaterID = theater.TheaterID }; productionService.CreateProduction(production2); dbcontext.SaveChanges(); var productionDateTime1 = new ProductionDateTime() { Date = DateTime.Parse("3/23/2019 3:22:29 PM"), Time = TimeSpan.Parse("10:30:00"), ProductionID = production1.ProductionID }; productionService.CreateProductionDateTime(production1.ProductionID, productionDateTime1); dbcontext.SaveChanges(); var productionDateTime2 = new ProductionDateTime() { Date = DateTime.Parse("3/29/2019 3:22:29 PM"), Time = TimeSpan.Parse("5:30:00"), ProductionID = production2.ProductionID }; productionService.CreateProductionDateTime(production2.ProductionID, productionDateTime2); dbcontext.SaveChanges(); var productionController = new ProductionController(); // Act var actionResult = productionController.GetProductions(currentDate: new DateTime(2019, 3, 1)); var response = actionResult as OkNegotiatedContentResult <List <ProductionResponseModel> >; var productions = response.Content; var expected = true; var actual = false; if (productions.Count > 0) { actual = true; } productionService.DeleteProductionDateTime(productionDateTime2); dbcontext.SaveChanges(); productionService.DeleteProductionDateTime(productionDateTime1); dbcontext.SaveChanges(); productionService.DeleteProduction(production1.ProductionID); dbcontext.SaveChanges(); productionService.DeleteProduction(production2.ProductionID); dbcontext.SaveChanges(); theaterService.DeleteTheater(theater); dbcontext.SaveChanges(); // Assert Assert.IsNotNull(response.Content); Assert.AreEqual(expected, actual); }