public async Task TwoOrders_SameProduct_ReturnOneRow() { CompleteOrderForCustomerTemplate order1 = await TestRunner.InsertTemplateAsync(new CompleteOrderForCustomerTemplate { ProductsTemplate = new ProductsTemplate().WithProductName("Product1"), Order_DetailsTemplate = new Order_DetailsTemplate().WithQuantity(5) }); await TestRunner.InsertTemplateAsync(new CompleteOrderForCustomerTemplate { CustomersTemplate = order1.CustomersTemplate, ProductsTemplate = order1.ProductsTemplate, Order_DetailsTemplate = new Order_DetailsTemplate().WithQuantity(8) }); QueryResult data = await TestRunner.ExecuteStoredProcedureQueryAsync("dbo.CustOrderHist", new DataSetRow { ["CustomerID"] = order1.CustomersTemplate.MergedData["CustomerID"] }); data .AssertRowCount(1) .AssertColumnsExist("ProductName", "Total") .AssertRowValues(0, new DataSetRow { ["ProductName"] = "Product1", ["Total"] = 13 }); }
public async Task SingleOrder_NoDiscount_ReturnOrderDetails() { CompleteOrderForCustomerTemplate order = await TestRunner.InsertTemplateAsync(new CompleteOrderForCustomerTemplate { ProductsTemplate = new ProductsTemplate().WithProductName("Product1"), Order_DetailsTemplate = new Order_DetailsTemplate().WithQuantity(5).WithUnitPrice(10.5m) }); QueryResult data = await TestRunner.ExecuteStoredProcedureQueryAsync("dbo.CustOrdersDetail", new DataSetRow { ["OrderID"] = order.OrdersTemplate.Identity }); data .AssertRowCount(1) .AssertColumnsExist("ProductName", "UnitPrice", "Quantity", "Discount", "ExtendedPrice") .AssertRowValues(0, new DataSetRow { ["ProductName"] = "Product1", ["UnitPrice"] = 10.5m, ["Quantity"] = (short)5, ["Discount"] = 0, ["ExtendedPrice"] = 52.5m }); }
public async Task SingleOrder_DefaultDates() { CompleteOrderForCustomerTemplate order = await TestRunner.InsertTemplateAsync(new CompleteOrderForCustomerTemplate { OrdersTemplate = new OrdersTemplate() .WithOrderID(1001), Order_DetailsTemplate = new Order_DetailsTemplate().WithQuantity(5) }); QueryResult data = await TestRunner.ExecuteStoredProcedureQueryAsync("dbo.CustOrdersOrders", new DataSetRow { ["CustomerID"] = order.CustomersTemplate.MergedData["CustomerID"] }); data .AssertRowCount(1) .AssertColumnsExist("OrderID", "OrderDate", "RequiredDate", "ShippedDate") .AssertRowValues(0, new DataSetRow { ["OrderID"] = 1001, ["OrderDate"] = null, ["RequiredDate"] = null, ["ShippedDate"] = null }); }