Example #1
0
 public void AddOrder()
 {
     Assert.IsNotNull(TestData.NewItem, "Failed because no item available -- requires successful AddItem test");
     // Make API call.
     ApiException gotException = null;
     try
     {
     AddOrderCall api = new AddOrderCall(this.apiContext);
     OrderType order = new OrderType();
     api.Order = order;
     TransactionType t1 = new TransactionType();
     t1.Item = TestData.NewItem;
     t1.TransactionID = "0";
     TransactionType t2 = new TransactionType();
     t2.Item = TestData.NewItem;
     t2.TransactionID = "0";
     TransactionTypeCollection tary = new TransactionTypeCollection();
         tary.Add(t1); tary.Add(t2);
     order.TransactionArray = tary;
     api.Order = order;
     // Make API call.
     /*AddOrderResponseType resp =*/ api.Execute();
     }
     catch(ApiException ex)
     {
         gotException = ex;
     }
     Assert.IsNotNull(gotException);
 }
        public void AddOrder()
        {
            Assert.IsNotNull(TestData.NewItem, "Failed because no item available -- requires successful AddItem test");
            // Make API call.
            ApiException gotException = null;

            try
            {
                AddOrderCall api   = new AddOrderCall(this.apiContext);
                OrderType    order = new OrderType();
                api.Order = order;
                TransactionType t1 = new TransactionType();
                t1.Item          = TestData.NewItem;
                t1.TransactionID = "0";
                TransactionType t2 = new TransactionType();
                t2.Item          = TestData.NewItem;
                t2.TransactionID = "0";
                TransactionTypeCollection tary = new TransactionTypeCollection();
                tary.Add(t1); tary.Add(t2);
                order.TransactionArray = tary;
                api.Order = order;
                // Make API call.
                /*AddOrderResponseType resp =*/ api.Execute();
            }
            catch (ApiException ex)
            {
                gotException = ex;
            }
            Assert.IsNotNull(gotException);
        }