Having a "CausesValidation" on a linkButton (the
default in .NET 2) gives the following error:
UnitTests.CheckControlsOnSinglePage :
NUnit.Extensions.Asp.ParseException : 'javascript:WebFo
rm_DoPostBackWithOptions(new WebForm_PostBackOptions
("LinkButton1", "", true, "", "", false, true))'
doesn't match expected pattern for postback in
LinkButton1 (LinkButtonTester 'LinkButton1' in web
form 'form1')
at NUnit.Extensions.Asp.ControlTester.PostBack
(String postBackScript)
at
NUnit.Extensions.Asp.AspTester.LinkButtonTester.Click()
at UnitTests.CheckControlsOnSinglePage() in .....
This can be recreated by (in .NET 2) simply having a
page with a linkButton, then pressing the Click method
on the linkButtonTester (as per the tutorial).
Setting "CausesValidation" to "false" stops this
exception being raised - but control is not performing
validation (which is required).
Is this a bug in the nUnitASP, or a mistake in my
setup?
Logged In: NO
I think that NUnitAsp cannot currently cope with this.
Looking at the code in WebFormTester.cs function IsPostBack
(), the test is looking for __doPostBack with two
underscores. In this case the string starts WebFo
rm_DoPostBackWithOptions and so will fail the test and not
be processed correctly.