コード例 #1
0
        public void Validation_ValidSelfReportedLoanNullLists()
        {
            SelfReportedLoanListModel srlList = new SelfReportedLoanListModel();

            srlList.Loans = null;

            bool bValid = srlList.IsValid();

            Assert.IsTrue(bValid, "This SelfReportedLoanList failed validation when it has a null Loan list.");
        }
コード例 #2
0
        public void Validation_ValidSelfReportedLoanListModel()
        {
            SelfReportedLoanModel     srl     = GetValidSelfReportedLoanData();
            SelfReportedLoanListModel srlList = new SelfReportedLoanListModel();

            srlList.Loans.Add(srl);

            bool bValid = srlList.IsValid();

            Assert.IsTrue(bValid, "A SelfReportedLoanListModel with all good information validated incorrectly.");
        }
コード例 #3
0
        public static bool ValidateInputSelfReportedLoanList(SelfReportedLoanListModel sr)
        {
            bool bValid = false;

            if (sr != null)
            {
                bValid = sr.IsValid();
                if (sr.Loans != null)
                {
                    foreach (SelfReportedLoanModel srl in sr.Loans)
                    {
                        bValid &= ValidateInputSelfReportedLoan(srl);
                        if (!bValid)
                        {
                            break;
                        }
                    }
                }
            }
            return(bValid);
        }