public void GetById() { var products = _productOptionLibrary.GetOptions(Guid.Empty, Guid.Parse("A21D5777-A655-4020-B431-624BB331E9A2")); var product = _productOptions.Find(x => x.Id == Guid.Parse("A21D5777-A655-4020-B431-624BB331E9A2")); Assert.AreEqual(products.First().Id, product.Id); Assert.AreEqual(products.First().Name, product.Name); Assert.AreEqual(products.First().Description, product.Description); Assert.AreEqual(products.First().ProductId, product.ProductId); }
public IHttpActionResult GetOptions(Guid productId) { try { var result = _productOptionLibrary.GetOptions(productId, Guid.Empty); return(Ok(result)); } catch (Exception ex) { return(BadRequest(ex.Message + ex.InnerException?.Message + ex.InnerException?.StackTrace)); } }