Esempio n. 1
0
        public void UpdateDoesntSaveNewProductOption()
        {
            var opt = new Mock <IProductOption>(MockBehavior.Strict);

            _repo.Setup(r => r.Get(_id1)).Returns <IProductOption>(null);
            _repo.Setup(r => r.Save(It.IsAny <IProductOption>(), It.IsAny <bool>())).Verifiable();

            _service.Update(_id1, opt.Object);

            _repo.Verify(r => r.Get(_id1), Times.Once);
            _repo.Verify(r => r.Save(It.IsAny <IProductOption>(), It.IsAny <bool>()), Times.Never);
        }
 public void Update(Guid id, ProductOption option)
 {
     _productOptionsService.Update(id, option);
 }
        public async Task <IHttpActionResult> Put(Guid productId, Guid optionId, [FromBody] ProductOptionsDto prodOpts)
        {
            await _service.Update(productId, optionId, _mapper.Map <ProductOption>(prodOpts));

            return(Ok());
        }