public async Task TestPaymentER_GetNewObject()
        {
            var payment = await PaymentER.NewPaymentER();

            Assert.NotNull(payment);
            Assert.False(payment.IsValid);
        }
        public async Task TestPaymentER_TestInvalidSave()
        {
            var payment = await PaymentER.NewPaymentER();

            Assert.False(payment.IsValid);
            Assert.Throws <ValidationException>(() => payment.Save());
        }
        // test exception if attempt to save in invalid state

        private async Task <PaymentER> BuildValidPaymentER()
        {
            var paymentER = await PaymentER.NewPaymentER();

            paymentER.Amount = 39.99;
            paymentER.Person = await PersonEC.GetPersonEC(new Person()
            {
                Id = 1
            });

            paymentER.LastUpdatedBy         = "edm";
            paymentER.LastUpdatedDate       = DateTime.Now;
            paymentER.Notes                 = "notes here";
            paymentER.PaymentDate           = DateTime.Now;
            paymentER.PaymentExpirationDate = DateTime.Now;
            paymentER.PaymentSource         = await PaymentSourceEC.GetPaymentSourceEC(new PaymentSource()
            {
                Id = 1
            });

            paymentER.PaymentType = await PaymentTypeEC.GetPaymentTypeEC(new PaymentType()
            {
                Id = 1
            });

            return(paymentER);
        }