public HttpResponseMessage DeleteShipCountry(Guid id) { var shipCountryToDelete = _shipCountryService.GetByKey(id); if (shipCountryToDelete == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } _shipCountryService.Delete(shipCountryToDelete); return(Request.CreateResponse(HttpStatusCode.OK)); }
public void Can_Delete_A_ShipCountry() { //// Arrange const string countryCode = "US"; var country = _storeSettingService.GetCountryByCode(countryCode); var shipCountry = new ShipCountry(_catalog.Key, country); _shipCountryService.Save(shipCountry); Assert.IsTrue(shipCountry.HasIdentity); var key = shipCountry.Key; //// Act _shipCountryService.Delete(shipCountry); //// Assert Assert.IsNull(_shipCountryService.GetByKey(key)); }