diff options
Diffstat (limited to 'tests/FunctionalTests/validators/protected/pages')
12 files changed, 535 insertions, 0 deletions
diff --git a/tests/FunctionalTests/validators/protected/pages/CausesValidation.page b/tests/FunctionalTests/validators/protected/pages/CausesValidation.page new file mode 100644 index 00000000..c6748b9a --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/CausesValidation.page @@ -0,0 +1,11 @@ +<com:TContent ID="Content">
+
+<h1>Test for CausesValidation="false"</h1>
+<div>
+<com:TTextBox ID="TestTextBox" />
+<com:TRequiredFieldValidator ID="TestRFValidator" ControlToValidate="TestTextBox" ErrorMessage="Field Required." />
+<com:TButton ID="TestButton" OnCommand="Page.onTest" Text="Test" CausesValidation="false" />
+<com:TLabel ID="Label1" />
+</div>
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/CompareValidator.page b/tests/FunctionalTests/validators/protected/pages/CompareValidator.page new file mode 100644 index 00000000..679d2e8e --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/CompareValidator.page @@ -0,0 +1,31 @@ +<com:TContent ID="Content">
+<h1>Prado CompareValidator Tests</h1>
+<div>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TTextBox ID="text2" />
+ <com:TCompareValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ControlToCompare="text2"
+ ErrorMessage="Must match"
+ ControlCssClass="required" />
+ </div>
+
+ <div>
+ <com:TTextBox ID="text3" />
+ <com:TCompareValidator
+ ID="validator2"
+ ControlToValidate="text3"
+ ValueToCompare="12/1/2005"
+ DataType="Date"
+ DateFormat="d/M/yyyy"
+ ErrorMessage="Must be a date 12/1/2005"
+ ControlCssClass="required" />
+ </div>
+
+ <com:TButton ID="submit1" Text="Test" />
+</div>
+
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/CustomValidator.page b/tests/FunctionalTests/validators/protected/pages/CustomValidator.page new file mode 100644 index 00000000..2d0d490b --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/CustomValidator.page @@ -0,0 +1,26 @@ +<com:TContent ID="Content">
+<h1>Prado CustomValidator Tests</h1>
+
+<script type="text/javascript">
+var MyCustomValidator =
+{
+ validate : function(sender, value)
+ {
+ return value == "Prado";
+ }
+}
+</script>
+<div>
+ <com:TTextBox ID="text1" />
+ <com:TCustomValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="Enter 'Prado'"
+ ControlCssClass="required"
+ ClientValidationFunction="MyCustomValidator.validate"
+ OnServerValidate="CustomValidation"
+ />
+ <com:TButton ID="submit1" Text="Test" />
+</div>
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/CustomValidator.php b/tests/FunctionalTests/validators/protected/pages/CustomValidator.php new file mode 100644 index 00000000..ed1f9433 --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/CustomValidator.php @@ -0,0 +1,14 @@ +<?php
+/*
+ * Created on 16/04/2006
+ */
+
+class CustomValidator extends TPage
+{
+ function CustomValidation($sender, $params)
+ {
+ $params->isValid = $this->text1->Text == "Prado";
+ }
+}
+
+?>
diff --git a/tests/FunctionalTests/validators/protected/pages/RangeValidatorDate.page b/tests/FunctionalTests/validators/protected/pages/RangeValidatorDate.page new file mode 100644 index 00000000..f7f65460 --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/RangeValidatorDate.page @@ -0,0 +1,48 @@ +<com:TContent ID="Content">
+<h1>Prado RangeValidator Tests Date</h1>
+<div>
+ <p>Dates between 22/1/2005 and 3/2/2005</p>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TRangeValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="Dates between 22/1/2005 and 3/2/2005"
+ MinValue="22/1/2005"
+ MaxValue="3/2/2005"
+ DataType="Date"
+ DateFormat="d/M/yyyy"
+ ControlCssClass="required" />
+ </div>
+ <p>Dates >= 22/1/2005</p>
+ <div>
+ <com:TTextBox ID="text2" />
+ <com:TRangeValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ ErrorMessage="Dates >= 22/1/2005"
+ MinValue="22/1/2005"
+ DataType="Date"
+ DateFormat="d/M/yyyy"
+ ControlCssClass="required" />
+ </div>
+
+ <p>Dates <= 3/2/2005</p>
+ <div>
+ <com:TTextBox ID="text3" />
+ <com:TRangeValidator
+ ID="validator3"
+ ControlToValidate="text3"
+ ErrorMessage="Dates <= 3/2/2005"
+ MaxValue="3/2/2005"
+ DataType="Date"
+ DateFormat="d/M/yyyy"
+ ControlCssClass="required" />
+ </div>
+
+ <com:TButton ID="submit1"Text="Test" />
+</div>
+
+
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/RangeValidatorFloat.page b/tests/FunctionalTests/validators/protected/pages/RangeValidatorFloat.page new file mode 100644 index 00000000..18c476c7 --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/RangeValidatorFloat.page @@ -0,0 +1,45 @@ +<com:TContent ID="Content">
+<h1>Prado RangeValidator Tests Float</h1>
+<div>
+ <p>Float between 1.4 and 4.4</p>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TRangeValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="Numbers between 1.4 and 4.4"
+ MinValue="1.4"
+ MaxValue="4.4"
+ DataType="Float"
+ ControlCssClass="required" />
+ </div>
+ <p>Float >= 2.2</p>
+ <div>
+ <com:TTextBox ID="text2" />
+ <com:TRangeValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ ErrorMessage="Numbers >= 2.2"
+ MinValue="2.2"
+ DataType="Float"
+ ControlCssClass="required" />
+ </div>
+
+ <p>Float <= 20.2</p>
+ <div>
+ <com:TTextBox ID="text3" />
+ <com:TRangeValidator
+ ID="validator3"
+ ControlToValidate="text3"
+ ErrorMessage="Numbers <= 20.2"
+ MaxValue="20.2"
+ DataType="Float"
+ ControlCssClass="required" />
+ </div>
+
+ <com:TButton ID="submit1"Text="Test" />
+</div>
+
+
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/RangeValidatorInteger.page b/tests/FunctionalTests/validators/protected/pages/RangeValidatorInteger.page new file mode 100644 index 00000000..922236e5 --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/RangeValidatorInteger.page @@ -0,0 +1,45 @@ +<com:TContent ID="Content">
+<h1>Prado RangeValidator Tests Integer</h1>
+<div>
+ <p>Integers between 1 and 4</p>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TRangeValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="Numbers between 1 and 4"
+ MinValue="1"
+ MaxValue="4"
+ DataType="Integer"
+ ControlCssClass="required" />
+ </div>
+ <p>Integers >= 2</p>
+ <div>
+ <com:TTextBox ID="text2" />
+ <com:TRangeValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ ErrorMessage="Numbers >= 2"
+ MinValue="2"
+ DataType="Integer"
+ ControlCssClass="required" />
+ </div>
+
+ <p>Integers <= 20</p>
+ <div>
+ <com:TTextBox ID="text3" />
+ <com:TRangeValidator
+ ID="validator3"
+ ControlToValidate="text3"
+ ErrorMessage="Numbers <= 20"
+ MaxValue="20"
+ DataType="Integer"
+ ControlCssClass="required" />
+ </div>
+
+ <com:TButton ID="submit1" Text="Test" />
+</div>
+
+
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/RangeValidatorString.page b/tests/FunctionalTests/validators/protected/pages/RangeValidatorString.page new file mode 100644 index 00000000..64e596d6 --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/RangeValidatorString.page @@ -0,0 +1,45 @@ +<com:TContent ID="Content">
+<h1>Prado RangeValidator Tests String</h1>
+<div>
+ <p>Strings between 'd' and 'y'</p>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TRangeValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="Strings between 'd' and 'y'"
+ MinValue="d"
+ MaxValue="y"
+ DataType="String"
+ ControlCssClass="required" />
+ </div>
+ <p>Strings >= 'd'</p>
+ <div>
+ <com:TTextBox ID="text2" />
+ <com:TRangeValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ ErrorMessage="Strings >= 'd'"
+ MinValue="d"
+ DataType="String"
+ ControlCssClass="required" />
+ </div>
+
+ <p>Strings <= 'y'</p>
+ <div>
+ <com:TTextBox ID="text3" />
+ <com:TRangeValidator
+ ID="validator3"
+ ControlToValidate="text3"
+ ErrorMessage="Strings <= 'y'"
+ MaxValue="y"
+ DataType="String"
+ ControlCssClass="required" />
+ </div>
+
+ <com:TButton ID="submit1"Text="Test" />
+</div>
+
+
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/RegularExpressionValidator.page b/tests/FunctionalTests/validators/protected/pages/RegularExpressionValidator.page new file mode 100644 index 00000000..ac24cd0d --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/RegularExpressionValidator.page @@ -0,0 +1,22 @@ +<com:TContent ID="Content">
+<h1>Prado RegularExpressionValidator Tests</h1>
+<div>
+ <div>
+ <com:TTextBox ID="text1" />
+ <com:TRegularExpressionValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ErrorMessage="5 digits"
+ RegularExpression="\d{5}"
+ ControlCssClass="required" />
+ <com:TTextBox ID="text2" />
+ <com:TEmailAddressValidator
+ ID="validator2"
+ ControlToValidate="text2"
+ ErrorMessage="Email Address!"
+ ControlCssClass="required" />
+ </div>
+ <com:TButton ID="submit1" Text="Test" />
+</div>
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/RequiredFieldValidator.page b/tests/FunctionalTests/validators/protected/pages/RequiredFieldValidator.page new file mode 100644 index 00000000..f8a1c4ca --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/RequiredFieldValidator.page @@ -0,0 +1,108 @@ +<com:TContent ID="Content">
+<h1>RequiredFieldValidator Tests</h1>
+<div>
+<!-- group 1 -->
+<com:TValidationSummary ID="summary1" ValidationGroup="group1" AutoUpdate="False" />
+<div>
+ <com:TTextBox ID="text1" />
+ <com:TRequiredFieldValidator
+ ID="validator1"
+ ControlToValidate="text1"
+ ControlCssClass="required"
+ Display="Dynamic"
+ CssClass="message"
+ ValidationGroup="group1"
+ ErrorMessage="text1!"/>
+
+ <com:TCheckBox ID="check1" />
+ <com:TRequiredFieldValidator
+ ID="validator2"
+ ControlToValidate="check1"
+ ControlCssClass="required"
+ Display="Dynamic"
+ CssClass="message"
+ ValidationGroup="group1"
+ ErrorMessage="check 1!" />
+ <com:TButton ID="submit1" Text="Group1" ValidationGroup="group1" />
+</div>
+<!-- group 2 -->
+<com:TValidationSummary ID="summary2" ValidationGroup="group2" />
+<div>
+ <com:TTextBox ID="text2" />
+ <com:TRequiredFieldValidator
+ ID="validator3"
+ ControlToValidate="text2"
+ ControlCssClass="required"
+ CssClass="message"
+ ValidationGroup="group2"
+ ErrorMessage="text2!"/>
+
+ <com:TCheckBox ID="check2" />
+ <com:TRequiredFieldValidator
+ ID="validator4"
+ ControlToValidate="check2"
+ ControlCssClass="required"
+ CssClass="message"
+ ValidationGroup="group2"
+ ErrorMessage="check 2!" />
+ <com:TButton ID="submit2" Text="Group2" ValidationGroup="group2"/>
+</div>
+
+<!-- no group -->
+<com:TValidationSummary ID="summary3" />
+
+<div>
+ <com:TTextBox ID="text3" />
+ <com:TRequiredFieldValidator
+ ID="validator5"
+ ControlToValidate="text3"
+ ControlCssClass="required"
+ CssClass="message"
+ ErrorMessage="text3!"/>
+
+ <com:TCheckBox ID="check3" />
+ <com:TRequiredFieldValidator
+ ID="validator6"
+ ControlToValidate="check3"
+ ControlCssClass="required"
+ CssClass="message"
+ ErrorMessage="check 3!" />
+</div>
+<div>
+ <com:TTextBox ID="text4" />
+ <com:TRequiredFieldValidator
+ ID="validator7"
+ ControlToValidate="text4"
+ ControlCssClass="required"
+ CssClass="message"
+ ErrorMessage="text4!"/>
+
+ <com:TCheckBox ID="check4" />
+ <com:TRequiredFieldValidator
+ ID="validator8"
+ ControlToValidate="check4"
+ ControlCssClass="required"
+ CssClass="message"
+ ErrorMessage="check 4!" />
+
+</div>
+ <com:TButton ID="submit3" Text="No Group" />
+
+
+
+<com:TButton ID="submit4" Text="Submit By Pass" CausesValidation="False" />
+
+</div>
+
+<div><h2>InitialValue Test</h2>
+ <com:TTextBox id="text5" Text="test"/>
+ <com:TRequiredFieldValidator
+ id="validator9"
+ ValidationGroup="group4"
+ ControlToValidate="text5"
+ InitialValue="test"
+ ErrorMessage="change 'test' to something else" />
+ <com:TButton id="submit5" Text="initial value" ValidationGroup="group4" />
+</div>
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/RequiredListValidator.page b/tests/FunctionalTests/validators/protected/pages/RequiredListValidator.page new file mode 100644 index 00000000..9bbd9d5a --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/RequiredListValidator.page @@ -0,0 +1,57 @@ +<com:TContent ID="Content">
+
+<div>
+ <div class="lista">
+ <com:TCheckBoxList ID="list1">
+ <com:TListItem Value="1" Text="One" />
+ <com:TListItem Value="2" Text="Two" />
+ <com:TListItem Value="3" Text="Three" />
+ <com:TListItem Value="4" Text="Four" />
+ </com:TCheckBoxList>
+ <com:TRequiredListValidator
+ ID="validator1"
+ ControlToValidate="list1"
+ ErrorMessage="Must select at least 1 and no more than 3"
+ ControlCssClass="required"
+ MinSelection="1"
+ MaxSelection="3" />
+
+ </div>
+ <div>
+ <com:TListBox ID="list2" SelectionMode="Multiple" Rows="5" Style="width:10em">
+ <com:TListItem Value="1" Text="One" />
+ <com:TListItem Value="2" Text="Two" />
+ <com:TListItem Value="3" Text="Three" />
+ <com:TListItem Value="4" Text="Four" />
+ <com:TListItem Value="5" Text="Five" />
+ </com:TListBox>
+ <com:TRequiredListValidator
+ ID="validator2"
+ ControlToValidate="list2"
+ ErrorMessage='Must select at least 2 and no more than 3 and value "two"'
+ MinSelection="2"
+ MaxSelection="3"
+ RequiredSelections="2" />
+ </div>
+
+ <div class="lista">
+ <com:TCheckBoxList ID="list3">
+ <com:TListItem Value="1" Text="One" />
+ <com:TListItem Value="2" Text="Two" />
+ <com:TListItem Value="3" Text="Three" />
+ <com:TListItem Value="4" Text="Four" />
+ </com:TCheckBoxList>
+ <com:TRequiredListValidator
+ ID="validator3"
+ ControlToValidate="list3"
+ ErrorMessage="Must select at least 1"
+ ControlCssClass="required"
+ MinSelection="1"/>
+
+ </div>
+
+
+ <com:TButton ID="submit1" Text="Test" />
+</div>
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/ValidationSummary.page b/tests/FunctionalTests/validators/protected/pages/ValidationSummary.page new file mode 100644 index 00000000..d260a93a --- /dev/null +++ b/tests/FunctionalTests/validators/protected/pages/ValidationSummary.page @@ -0,0 +1,83 @@ +<com:TContent ID="Content">
+
+<h1>Validation Summary Test</h1>
+<fieldset id="quickRegistration">
+ <legend>Create New Account</legend>
+
+<div class="username">
+ Username:
+ <com:TTextBox ID="Username" />
+ <com:TRequiredFieldValidator
+ ID="UsernameVal"
+ ControlToValidate="Username"
+ Display="None"
+ ValidationGroup="registration"
+ ErrorMessage="a username is required." />
+</div>
+<div class="password">
+ Password
+ <com:TTextBox ID="Password" TextMode="Password" />
+</div>
+<com:TRequiredFieldValidator
+ ID="PasswordVal"
+ ControlToValidate="Password"
+ Display="None"
+ ValidationGroup="registration"
+ ErrorMessage="a password is required." />
+
+<div class="create">
+ <com:TButton ID="Create" ValidationGroup="registration" Text="Create New Account"/>
+</div>
+
+<div class="registrationSummary">
+ <com:TValidationSummary
+ ID="summary1"
+ ValidationGroup="registration"
+ AutoUpdate="false"
+ HeaderText="<p>Unable to create new account because</p>" />
+</div>
+
+</fieldset>
+
+
+<fieldset id="LoginForm">
+ <legend>Sign In</legend>
+
+<div class="username">
+ Login Name:
+ <com:TTextBox ID="UserID" />
+
+ <com:TRequiredFieldValidator
+ ID="UserVal1"
+ ControlToValidate="UserID"
+ Display="None"
+ ValidationGroup="signin"
+ ErrorMessage="the username or email was not provided" />
+</div>
+
+<div class="password" >
+ Password:
+ <com:TTextBox ID="Pass" TextMode="Password" />
+ <com:TRequiredFieldValidator
+ ID="loginValidator3"
+ ControlToValidate="Pass"
+ Display="None"
+ ValidationGroup="signin"
+ ErrorMessage="the password was not provided" />
+</div>
+
+
+<com:TButton ID="login" ValidationGroup="signin" CssClass="button" Text="Sign In" />
+
+<div class="validation">
+ <com:TValidationSummary
+ ID="summary2"
+ ValidationGroup="signin"
+ AutoUpdate="false"
+ HeaderText="<p>You could not login because</p>" />
+</div>
+
+</fieldset>
+
+
+</com:TContent>
\ No newline at end of file |