Example #1
0
        public void Delete_Test_ProductOptionsRepositoryDeleteShouldBeCalled()
        {
            var guid = new Guid();

            _productOptionsRepositoryMock.Setup(m => m.Delete(guid));

            _underTest.Delete(guid);

            _productOptionsRepositoryMock.Verify(m => m.Delete(guid), Times.Once);
        }
        public HttpResponseMessage DeleteOption(Guid productId, Guid id)
        {
            try
            {
                var updated = _optionService.Delete(productId, id);
                if (updated)
                {
                    return(Request.CreateResponse(HttpStatusCode.NoContent));
                }

                return(Request.NotFound(id));
            }
            catch (Exception e)
            {
                return(Request.Error(e.Message));
            }
        }