예제 #1
0
        public void ShouldGetUpdatedOrders()
        {
            var store = new AmazonStore();
            var results = store.GetUpdatedAmazonOrdersViaFecther();

            results.Count.ShouldBeGreaterThan(1);
        }
예제 #2
0
 public void GetSpecificOrderAndMapToAx()
 {
     var store = new AmazonStore();
     var amazonId = "102-2130201-6848236";
     dynamic table = new AmazonOrders();
     var rec = table.First(OrderNumber:amazonId);
     var salesOrder= store.MapFromAmazonCache(rec);
     store.GetOrderItems(salesOrder);
 }
예제 #3
0
 public void GetUnprocessedOrders()
 {
     var store = new AmazonStore();
     var results = store.GetUnprocessedOrders();
     results.Count.ShouldBeGreaterThan(1);
     var twoLines = results.Where(x => x.OrderId == "103-1460378-9201802");
     twoLines.Count().ShouldBe(1);
     twoLines.First().LineItems.Count.ShouldBe(2);
 }
예제 #4
0
        public void ShouldGetNewOrders()
        {
            var store = new AmazonStore();
            var results = store.GetNewOrders();

            results.Count.ShouldBeGreaterThan(1);
            results.ForEach(x => Console.WriteLine(x.OrderId));
            var orderService = new OrderService();
            //results.ForEach(x => orderService.CreateAmazonOrder(x));
        }
예제 #5
0
        public void ProcessAmazonOrders()
        {
            var store = new AmazonStore();

            var newOrders = store.GetNewOrders();
            // also need to update exiting pendings ...!!!
            NLog.LogManager.GetCurrentClassLogger().Info("New amazon orders: {0}", newOrders.Count);
            newOrders.ForEach(x => CreateAmazonOrder(x));

            var unprocessedOrders = store.GetUnprocessedOrders();
            unprocessedOrders.ForEach(x => CreateAxSalesOrder(x, "Amazon"));
        }