Page 1 of 1

Validation fail despite it looking successful to me.

Posted: Tue Jun 26, 2018 1:28 pm
by sstowe
I have the following user code to perform validation:

Code: Select all

        public void Validate_PaymentTotal(RepoItemInfo h1tagInfo)
        {
        	
        	Decimal number = Convert.ToDecimal(PaymentAmount);
        	string paymentTotal = "Payment Total " + String.Format("{0:n}", number);
        	
            Report.Log(ReportLevel.Info, "Validation", "Validating AttributeEqual (InnerText=$PaymentAmount) on item 'h1tagInfo'.", h1tagInfo);
            Validate.AttributeEqual(h1tagInfo, "InnerText", paymentTotal);
        }
A user may enter a numeric value in an <input> The app appends ".00" to the H3 text that I am trying to validate when a user does not input it. This validation fails. See attached log screen shot.

Re: Validation fail despite it looking successful to me.

Posted: Tue Jun 26, 2018 1:32 pm
by odklizec
Hi,

There appears to be a space after 'actual' Payment Total 1.00. Just examine the report closely ;)

Re: Validation fail despite it looking successful to me.

Posted: Tue Jun 26, 2018 2:09 pm
by sstowe
Don't I feel like an idiot. Off to get more coffee. Thanks.

Re: Validation fail despite it looking successful to me.

Posted: Tue Jun 26, 2018 2:12 pm
by odklizec
Don't be so hard to yourself. It happens to me frequently ;)

Re: Validation fail despite it looking successful to me.

Posted: Tue Jun 26, 2018 2:18 pm
by sstowe
:D