示例#1
0
        public void TestValidatePaymentStringBasic()
        {
            Debug.WriteLine("validatePaymentString");

            string paymentString = "SPD*1.0*232131";
            List <SmartPaymentValidationError> result = SmartPaymentValidator.ValidatePaymentString(paymentString);

            // 1 error is expected
            Assert.AreEqual(result.Count, 1);
        }
示例#2
0
        public void TestDoubleStarInString()
        {
            Debug.WriteLine("testDoubleStarInString");
            string paymentString = "SPD*1.0*AM:100**ACC:CZ05678876589087329";
            List <SmartPaymentValidationError> result = SmartPaymentValidator.ValidatePaymentString(paymentString);

            // 0 error is expected
            if (result != null && result.Count > 0)
            {
                Debug.WriteLine(result[0].ErrorDescription);
            }
            Assert.AreEqual(result.Count, 1);
        }
示例#3
0
        public void TestValidatePaymentStringAlternateAccounts()
        {
            Debug.WriteLine("testValidatePaymentStringAlternateAccounts");
            string paymentString = "SPD*1.0*ACC:CZ3155000000001043006511+RBCZ66*ALT-ACC:CZ3155000000001043006511+RBCZ66,CZ3155000000001043006511+RBCZ66,CZ3155000000001043006511+RBCZ66";
            List <SmartPaymentValidationError> result = SmartPaymentValidator.ValidatePaymentString(paymentString);

            // 0 error is expected
            if (result != null && result.Count > 0)
            {
                Debug.WriteLine(result[0].ErrorDescription);
            }
            Assert.Null(result);
        }
示例#4
0
        public void TestValidatePaymentStringSimpleCorrect()
        {
            Debug.WriteLine("validatePaymentString");
            string paymentString = "SPD*1.0*ACC:CZ3155000000001043006511";
            List <SmartPaymentValidationError> result = SmartPaymentValidator.ValidatePaymentString(paymentString);

            // 0 error is expected
            if (result != null && result.Count > 0)
            {
                Debug.WriteLine(result[0].ErrorDescription);
            }
            Assert.Null(result);
        }