--- TestDoWhileProcedure.java	Thu Aug  6 16:57:10 2009
+++ TestWhileDoProcedure.java	Thu Aug  6 16:56:45 2009
@@ -34,24 +34,24 @@
  * @version $Revision: 666345 $ $Date: 2008-06-11 07:13:44 +0900 (水, 11  6月 2008) $
  * @author Herve Quiroz
  */
-public class TestDoWhileProcedure extends BaseFunctorTest {
+public class TestWhileDoProcedure extends BaseFunctorTest {
 
     // Conventional
     // ------------------------------------------------------------------------
 
-    public TestDoWhileProcedure(String testName) {
+    public TestWhileDoProcedure(String testName) {
         super(testName);
     }
 
     public static Test suite() {
-        return new TestSuite(TestDoWhileProcedure.class);
+        return new TestSuite(TestWhileDoProcedure.class);
     }
 
     // Functor Testing Framework
     // ------------------------------------------------------------------------
 
     protected Object makeFunctor() {
-        return new DoWhileProcedure(NoOp.INSTANCE, Constant.FALSE);
+        return new WhileDoProcedure(Constant.FALSE, NoOp.INSTANCE);
     }
 
     // Lifecycle
@@ -83,7 +83,7 @@
 
 
     private List<Object> getList() {
-        List<Object> list = new LinkedList<Object>();
+        List<Object> list=new LinkedList<Object>();
         list.add("a");
         list.add("b");
         list.add("c");
@@ -97,7 +97,7 @@
 
         Procedure action=new ListRemoveFirstProcedure(list);
         Predicate condition=new Not(new BoundPredicate(new IsEmpty<List<Object>>(), list));
-        Procedure procedure=new DoWhileProcedure(action, condition);
+        Procedure procedure=new WhileDoProcedure(condition, action);
 
         assertTrue("The condition should be true before running the loop", condition.test());
         assertFalse("The list should not be empty then", list.isEmpty());
@@ -114,20 +114,21 @@
                           return count-- > 0;
                       }
                   };
-        procedure=new DoWhileProcedure(action, condition);
+        procedure=new WhileDoProcedure(condition, action);
         procedure.run();
         assertFalse("The list should not contain \"a\" anymore", list.contains("a"));
         assertFalse("The list should not contain \"b\" anymore", list.contains("b"));
-        assertFalse("The list should not contain \"c\" anymore", list.contains("c"));
+        assertTrue("The list should still contain \"c\"", list.contains("c"));
         assertTrue("The list should still contain \"d\"", list.contains("d"));
     }
 
     public void testLoopForNothing() {
         List<Object> list=getList();
         Procedure action=new ListRemoveFirstProcedure(list);
-        Procedure procedure=new DoWhileProcedure(action, Constant.FALSE);
+        Procedure procedure=new WhileDoProcedure(Constant.FALSE, action);
         assertTrue("The list should contain 4 elements before runnning the loop", list.size()==4);
         procedure.run();
-        assertTrue("The list should contain 3 elements after runnning the loop", list.size()==3);
+        assertTrue("The list should contain 4 elements after runnning the loop", list.size()==4);
     }
 }
+
