Exemple #1
0
        public string Verify()
        {
            string addendaMessage = "";

            addendaMessage  = LengthCheck.CheckLength("Addenda Record Type", RecordType, RECORD_TYPE_LENGTH);
            addendaMessage += ExpectedString.CheckString("Addenda Record Type", RecordType, new string[] { RECORD_TYPE });
            addendaMessage += LengthCheck.CheckLength("Addenda Type", AddendaType, ADDENDA_TYPE_LENGTH);

            addendaMessage += ExpectedString.CheckString("Addenda Type", AddendaType, ADDENDA_TYPES);

            addendaMessage += LengthCheck.CheckLength("Payment Info", PaymentInfo, PAYMENT_INFO_LENGTH);
            addendaMessage += LengthCheck.CheckLength("Addenda Sequence", AddendaSequence, ADDENDA_SEQUENCE_LENGTH);
            addendaMessage += LengthCheck.CheckLength("Entry Sequence", EntrySequence, ENTRY_SEQUENCE_LENGTH);

            addendaMessage += ExpectedString.CheckNumericWithSpaces("Addenda Sequence", AddendaSequence);
            addendaMessage += ExpectedString.CheckNumericWithSpaces("Entry Detail Sequence", EntrySequence);

            if (AddendaPrinter.PrintAddenda(this).Length != 94)
            {
                addendaMessage += "\nAddenda is not 94 characters long: '" + AddendaPrinter.PrintAddenda(this) + "'";
            }

            if (!string.IsNullOrEmpty(addendaMessage))
            {
                addendaMessage = "Errors in Addenda with " + AddendaPrinter.PrintAddendaVerbose(this) + ": " + addendaMessage;
            }
            return(addendaMessage);
        }
Exemple #2
0
        public void Password_InvalidLength()
        {
            PropertyCheck password = new PropertyCheck("Afghj");
            LengthCheck   length   = new LengthCheck();
            bool          result   = length.checkPassword(password);

            Assert.AreEqual(false, result);
        }
Exemple #3
0
        public void Password_Valid()
        {
            PropertyCheck password = new PropertyCheck("Al1@sdfghj");
            LengthCheck   length   = new LengthCheck();
            bool          result   = length.checkPassword(password);

            Assert.AreEqual(true, result);
        }
 public void Setup() => _check = new LengthCheck(RequiredLen);