コード例 #1
0
        public void ReturnDataGetNewContactIdFromContactApi()
        {
            var repo = new OrderAggregateRepository();
              Order order = Order.CreateOrderNewContact("Julie", "Lerman", TheAddress(), "Friend");

              Guid result = repo.GetNewContactIdFromContactApi(order).Result;
              Assert.AreNotEqual(Guid.Empty, result);
        }
コード例 #2
0
        public void SaveNewOrderWithNewContact()
        {
            var repo = new OrderAggregateRepository();
              Order order = Order.CreateOrderNewContact("Julie", "Lerman", TheAddress(), "Friend");
              order.SetOrderDetails(false, "abcde", "good order", 0, 0);
              order.CreateLineItem(Guid.NewGuid(), 5.55, 2);

              bool result = repo.Update(order).Result;
              Assert.AreNotEqual(Guid.Empty, result);
        }
コード例 #3
0
        public void SaveNewOrderWithNewCustomer()
        {
            var repo = new OrderAggregateRepository();
              Order order = Order.CreateOrderNewCustomer(Guid.NewGuid(), TheAddress());
              order.SetOrderDetails(false, "abcde", "good order", 0, 0);
              order.CreateLineItem(Guid.NewGuid(), 5.55, 2);

              bool result = repo.Update(order).Result;
              Debug.WriteLine(order.Customer.ContactId);
              Assert.AreNotEqual(Guid.Empty, order.Customer.ContactId);
        }
コード例 #4
0
        public void BeAbleToCallWebApi()
        {
            var repo = new OrderAggregateRepository();
              Order order = Order.CreateOrderNewContact("Julie", "Lerman", TheAddress(), "Friend");
              try {
            Guid result = repo.GetNewContactIdFromContactApi(order).Result;
              }
              catch (Exception ex) {
            if ((ex.InnerException).InnerException.Message.Contains("Unable to connect to the remote server")) {
              Assert.Fail(
            "You need to run the Contact Management Services API project to run the SalesOrder Repo Tests. Run that without debugging (e.g. CTRL+F5 or Ctrl+Shift+W). Note that debugging the tests will start that up for you.");
            }
            throw;
              }

              Assert.IsTrue(true);
        }