public void ShouldPassMultipleInputValidations()
        {
            string opName = "PlaceOrder";
            ValidationParameterInspector inspector = GetInspector(opName, typeof(ITestService));

            string customerId = "AGoodCustomer";
            TaxInfo taxInfo = new TaxInfo("123434", "WA");
            ItemInfo itemInfo = new ItemInfo("Item002", "A Fictitious book", 2);
            CustomerDiscountInfo discountInfo = new CustomerDiscountInfo(customerId, .15);

            inspector.BeforeCall(opName,
                                 new object[] { customerId, taxInfo, itemInfo, discountInfo });
        }
        public void ShouldHaveProperFailureReportsInFault()
        {
            string opName = "PlaceOrder";
            ValidationParameterInspector inspector = GetInspector(opName, typeof(ITestService));

            string customerId = "AGoodCustomer";
            TaxInfo taxInfo = new TaxInfo("123434", "Not a state");
            ItemInfo itemInfo = new ItemInfo("1", "A Fictitious book", -2);
            CustomerDiscountInfo discountInfo = new CustomerDiscountInfo(customerId, .15);

            try
            {
                inspector.BeforeCall(opName,
                                     new object[] { customerId, taxInfo, itemInfo, discountInfo });
                Assert.Fail("Should not have gotten here, was expecting ValidationFault");
            }
            catch (FaultException<ValidationFault> e)
            {
                ValidationFault yourFault = e.Detail;
                Assert.AreEqual(3, yourFault.Details.Count);
            }
        }
예제 #3
0
 public void PlaceOrder(
     string customerId, TaxInfo taxInfo, ItemInfo itemInfo, CustomerDiscountInfo discountInfo)
 {
 }
 public void PlaceOrder(
     string customerId, TaxInfo taxInfo, ItemInfo itemInfo, CustomerDiscountInfo discountInfo)
 {
     
 }