[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit WebFormTest.java,1.15,1.16
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-01-08 14:29:30
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv5179/test/com/meterware/httpunit
Modified Files:
WebFormTest.java
Log Message:
More refactoring
Index: WebFormTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/WebFormTest.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- WebFormTest.java 2001/12/11 21:41:38 1.15
+++ WebFormTest.java 2002/01/08 14:29:27 1.16
@@ -122,8 +122,9 @@
assertNotNull( parameters );
assertMatchingSet( "form parameter names", new String[] { "first", "name", "second" }, parameters );
- assertEquals( "First checkbox", "", form.getParameterValue( "first" ) );
+ assertNull( "First checkbox has a non-null value", form.getParameterValue( "first" ) );
assertEquals( "Second checkbox", "on", form.getParameterValue( "second" ) );
+ assertNull( "Found extraneous value for unknown parameter 'magic'", form.getParameterValue( "magic" ) );
assertTrue( "Did not find parameter 'first'", form.hasParameterNamed( "first" ) );
assertTrue( "Did not find parameter with prefix 'sec'", form.hasParameterStartingWithPrefix( "sec" ) );
assertTrue( "Did not find parameter with prefix 'nam'", form.hasParameterStartingWithPrefix( "nam" ) );
@@ -230,6 +231,7 @@
String[] parameterNames = form.getParameterNames();
assertEquals( "num parameters", 1, parameterNames.length );
assertEquals( "parameter name", "colors", parameterNames[0] );
+ assertTrue( "Found extraneous values for unknown parameter 'magic'", form.getParameterValues( "magic" ).length == 0 );
assertMatchingSet( "Select defaults", new String[] { "red", "pink" }, form.getParameterValues( "colors" ) );
assertMatchingSet( "Select options", new String[] { "blue", "red", "green", "salmon" }, form.getOptions( "colors" ) );
assertEquals( "Select values", new String[] { "blue", "red", "green", "pink" }, form.getOptionValues( "colors" ) );
|