summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/tests/ValidationTests.html
diff options
context:
space:
mode:
authorwei <>2006-01-09 03:40:59 +0000
committerwei <>2006-01-09 03:40:59 +0000
commit9c9a2d731fea9679f65904a3a6b72dd78b4253a4 (patch)
tree1d81a12a7a79e74e98218d01c6278a81f0996f5d /framework/Web/Javascripts/tests/ValidationTests.html
parent10420d2bcde1a7437b58175f417170b2d6d93e50 (diff)
Update library
Diffstat (limited to 'framework/Web/Javascripts/tests/ValidationTests.html')
-rw-r--r--framework/Web/Javascripts/tests/ValidationTests.html79
1 files changed, 0 insertions, 79 deletions
diff --git a/framework/Web/Javascripts/tests/ValidationTests.html b/framework/Web/Javascripts/tests/ValidationTests.html
deleted file mode 100644
index 67c9aecb..00000000
--- a/framework/Web/Javascripts/tests/ValidationTests.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Prado Client-Side Validation Tests</title>
- <link rel="stylesheet" type="text/css" href="jsunit/css/jsUnitStyle.css">
- <script language="JavaScript" type="text/javascript" src="jsunit/app/jsUnitCore.js"></script>
-<!-- unit tests -->
-<!-- base files -->
-<script language="JavaScript" Type="text/javascript" src="../../base.js"></script>
-<script language="JavaScript" Type="text/javascript" src="../../dom.js"></script>
-<!-- library file -->
-<script language="JavaScript" Type="text/javascript" src="../library/validation/validator.js"></script>
-<script language="JavaScript" type="text/javascript">
-
- function testConvertInteger()
- {
- var convert = Prado.Validation.Util;
-
- //test integers
- assertEquals("Integer 10", 10, convert.toInteger("10"));
- assertNull("Not an integer", convert.toInteger("10.0"));
- assertEquals("+ integer", 10, convert.toInteger(" +10 "));
- }
-
- function testConvertDouble()
- {
- var convert = Prado.Validation.Util;
-
- //test doubles
- assertEquals("Double 10.0", 10.0, convert.toDouble("10.0","."));
- assertNull("Not a double", convert.toDouble("10.0s"));
- assertEquals("+ double", 10.2, convert.toDouble(" +10.2 "));
- }
-
- function testConvertAsCurrency()
- {
- var convert = Prado.Validation.Util;
-
- //test currency convert
- assertEquals("10 Dollars", 10, convert.toCurrency("10.00"));
- assertEquals("10,000 Dollars", 10000.10, convert.toCurrency("10,000.10"));
-
- //using space as grouping
- assertEquals("10 000 Dollars", 10000.10, convert.toCurrency("10 000.10", " "));
-
- assertEquals("1 0000 Yen", 10000, convert.toCurrency("1 0000", " ",0));
-
- assertNull("Not 10 Dollars", convert.toCurrency("$10.0"));
- }
-
- function testConvertToDate()
- {
- var convert = Prado.Validation.Util;
-
- //test dates !! Months are zero based for javascript Date objects !!
- var testDate = (new Date(2005, 05, 20)).valueOf();
- assertEquals("Matching date 2005 May 20", testDate, convert.toDate("2005-06-20", "%Y-%m-%d"));
- }
-
- function testValidatorConversion()
- {
- var validator = new Prado.Validation(null, {id : "", controltovalidate : "", groupchar: " ", digits : 0});
- assertEquals("Integer 10", 10, validator.convert("Integer", "10"));
- assertEquals("10 000 Yen", 10000, validator.convert("Currency", "10 000"));
- }
-</script>
- </head>
-
- <body>
- <h1>Prado Client-Side Validation Tests</h1>
-
- <p>This page contains tests for the utility functions
- that JsUnit uses. To see them, take a look at the source.</p>
- </body>
-</html>
-