예제 #1
0
        public async Task Db_GetSalesOrderHeadersAsync()
        {
            using (var db = await MockSalesOrder.CreateAsync(CreateDb()))
            {
                var result = await db.GetSalesOrderHeadersAsync(null, null);

                Assert.AreEqual(4, result.Count);
            }
        }
예제 #2
0
        public async Task Db_GetSalesOrderHeadersAsync_filter()
        {
            using (var db = await MockSalesOrder.CreateAsync(CreateDb()))
            {
                var result = await db.GetSalesOrderHeadersAsync("PO19952192051", null);

                Assert.AreEqual(1, result.Count);
                Assert.AreEqual("PO19952192051", result._.PurchaseOrderNumber[0]);
            }
        }
예제 #3
0
        public async Task Db_GetSalesOrderHeadersAsync_sort()
        {
            var orderBy = new IColumnComparer[] { DataRow.OrderBy(new SalesOrderHeader().PurchaseOrderNumber, SortDirection.Descending) };

            using (var db = await MockSalesOrder.CreateAsync(CreateDb()))
            {
                var result = await db.GetSalesOrderHeadersAsync(null, orderBy);

                Assert.AreEqual(4, result.Count);
                var _ = result._;
                Assert.AreEqual("PO348186287", _.PurchaseOrderNumber[0]);
                Assert.AreEqual("PO19952192051", _.PurchaseOrderNumber[1]);
                Assert.AreEqual("PO19604173239", _.PurchaseOrderNumber[2]);
                Assert.AreEqual("PO19372114749", _.PurchaseOrderNumber[3]);
            }
        }
예제 #4
0
        public async Task Db_DeleteSalesOrder()
        {
            var salesOrders = DataSet <SalesOrderHeader.Key> .Create();

            salesOrders.AddRow(x =>
            {
                salesOrders._.SalesOrderID[x] = 1;
            });

            using (var db = await MockSalesOrder.CreateAsync(CreateDb()))
            {
                await db.DeleteSalesOrderAsync(salesOrders);

                Assert.AreEqual(3, await db.SalesOrderHeader.CountAsync());
            }
        }