public ActionResult GetProducts() { return(this.Direct(new[] { ProductTestFixtures.GetProductDtoListWithThreeItems() })); }
public ActionResult GetProduct(JObject id) { if (Guid.Parse(id.Value <string>("id")).CompareTo(Guid.Empty) == 0) { return(this.Direct(new { success = false })); } var product = ProductTestFixtures.GetDopamineDto(); return(this.Direct(new { success = true, data = product })); }
public void ThatProductCanBeCreatedUsingFluentConstructor() { var product = Product.Create(ProductTestFixtures.GetProductDtoWithNoSubstances()) .Shape(ShapeTestFixtures.CreateIvFluidShape()) .Package(PackageTestFixtures.CreatePackageAmpul()) .Quantity(UnitTestFixtures.CreateUnitMililiter(), 5M) .Substance(1, SubstanceTestFixtures.CreateSubstanceWithoutGroup(), 200, UnitTestFixtures.CreateUnitMilligram()) .Route(RouteTestFixtures.CreateRouteIv()); Assert.IsInstanceOfType(product, typeof(Product)); }
public void ThatProductCreateFailsWhenNoShape() { var dto = ProductTestFixtures.GetProductDtoWithNoSubstances(); var package = PackageTestFixtures.CreatePackageAmpul(); const decimal prodQuantity = 5M; var unit = UnitTestFixtures.CreateUnitMililiter(); var subst = SubstanceTestFixtures.CreateSubstanceWithoutGroup(); const int order = 1; const decimal quantity = 200; var substUnit = UnitTestFixtures.CreateUnitMilligram(); var route = RouteTestFixtures.CreateRouteIv(); AssertCreateFails(quantity, subst, substUnit, route, order, null, dto, package, prodQuantity, unit); }
private static IProduct GetProduct() { var product = ProductServices.WithDto(ProductTestFixtures.GetProductDtoWithTwoSubstancesAndRoute()).Get(); return(product); }