Exemple #1
0
        public void FailedValidationTest()
        {
            var customerBus = new busCustomer();

            var custExisting = customerBus.Load(1);

            var cust = new Customer()
            {
                // create dupe values which should fail validation
                FirstName = custExisting.FirstName,
                LastName  = custExisting.LastName,
                Company   = custExisting.Company
            };

            cust = customerBus.NewEntity(cust);

            Assert.IsFalse(customerBus.Validate());
            Assert.IsFalse(string.IsNullOrEmpty(customerBus.ErrorMessage));
            Console.WriteLine("Validation Failed (test passed): " + customerBus.ErrorMessage);
        }