Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }