public void GetProductOptionById_gets_a_ProductOption_via_repository()
        {
            //Act
            var productOption = _productOptionService.GetProductOptionById(new Guid("0643ccf0-ab00-4862-b3c5-40e2731abcc9"));

            //Assert
            Assert.IsNotNull(productOption);
            Assert.AreEqual(productOption.Name, "White");
        }
Exemplo n.º 2
0
        public void UpdateOption(Guid id, ProductOption option)
        {
            try
            {
                var original = _productOptionService.GetProductOptionById(id);

                if (original != null)
                {
                    original.Name        = option.Name;
                    original.Description = option.Description;
                    original.ProductId   = option.ProductId;
                    _productOptionService.UpdateProductOption(original);
                }
                else
                {
                    //
                    throw new HttpResponseException(HttpStatusCode.Forbidden);
                }
            }
            catch (Exception ex)
            {
                _loggingService.Error(ex);
                throw;
            }
        }