public ProductOptions GetOptions(Guid productId) { return(new ProductOptions() { Items = _productOptionservice.GetOptionsByProductID(productId) }); }
public void TestGetOptionsByProductIDService() { //Arrange _helper._mockProductOptionsTable.Clear(); _helper._mockProductOptionsTable.Add(_testProductOption); _helper._mockProductOptionsTable.Add(_testProductOption0); //Act var result = _testService.GetOptionsByProductID(_testProduct.Id); //Assert Assert.AreEqual(2, result.Count()); Assert.IsTrue(result.Any(p => p.Id == _testProductOption.Id)); Assert.IsTrue(result.Any(p => p.ProductId == _testProduct.Id)); Assert.IsTrue(result.Any(p => p.Description == _testProductOption.Description)); Assert.IsTrue(result.Any(p => p.Name == _testProductOption.Name)); Assert.IsTrue(result.Any(p => p.Id == _testProductOption0.Id)); Assert.IsTrue(result.Any(p => p.ProductId == _testProduct.Id)); Assert.IsTrue(result.Any(p => p.Description == _testProductOption0.Description)); Assert.IsTrue(result.Any(p => p.Name == _testProductOption0.Name)); }