Index: src/unittests/ActionSequenceTest.cpp
===================================================================
--- src/unittests/ActionSequenceTest.cpp	(revision 1473396142bb336f3624ec2b15023c20cfe170ea)
+++ src/unittests/ActionSequenceTest.cpp	(revision 1473396142bb336f3624ec2b15023c20cfe170ea)
@@ -0,0 +1,139 @@
+/*
+ * ActionSequenzTest.cpp
+ *
+ *  Created on: Dec 17, 2009
+ *      Author: crueger
+ */
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "unittests/ActionSequenceTest.hpp"
+#include "Actions/Action.hpp"
+#include "Actions/ActionSequence.hpp"
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( ActionSequenceTest );
+
+void setUp();
+void tearDown();
+
+void canUndoTest();
+
+/* some neccessary stubs for tests */
+class canUndoActionStub : public Action
+{
+public:
+  canUndoActionStub(){}
+  virtual ~canUndoActionStub(){}
+
+  virtual void call(){}
+  virtual void undo(){}
+  virtual bool canUndo(){
+    return true;
+  }
+};
+
+class cannotUndoActionStub : public Action
+{
+public:
+  cannotUndoActionStub(){}
+  virtual ~cannotUndoActionStub(){}
+
+  virtual void call(){}
+  virtual void undo(){}
+  virtual bool canUndo(){
+    return false;
+  }
+};
+
+void ActionSequenceTest::setUp(){}
+void ActionSequenceTest::tearDown(){}
+
+void ActionSequenceTest::canUndoTest(){
+
+  // create some necessary stubs used in this test
+  Action *positive1 = new canUndoActionStub();
+  Action *positive2 = new canUndoActionStub();
+  Action *negative1 = new cannotUndoActionStub();
+  Action *negative2 = new cannotUndoActionStub();
+
+  // first section:
+  {
+    // test some combinations
+    {
+      ActionSequence *sequence = new ActionSequence();
+      sequence->addAction(positive1);
+      sequence->addAction(positive2);
+      CPPUNIT_ASSERT_EQUAL( true, sequence->canUndo() );
+      delete sequence;
+    }
+    {
+      ActionSequence *sequence = new ActionSequence();
+      sequence->addAction(positive1);
+      sequence->addAction(negative2);
+      CPPUNIT_ASSERT_EQUAL( false, sequence->canUndo() );
+      delete sequence;
+    }
+    {
+      ActionSequence *sequence = new ActionSequence();
+      sequence->addAction(negative1);
+      sequence->addAction(positive2);
+      CPPUNIT_ASSERT_EQUAL( false, sequence->canUndo() );
+      delete sequence;
+    }
+    {
+      ActionSequence *sequence = new ActionSequence();
+      sequence->addAction(negative1);
+      sequence->addAction(negative2);
+      CPPUNIT_ASSERT_EQUAL( false, sequence->canUndo() );
+      delete sequence;
+    }
+  }
+
+  // second section:
+  {
+    // empty sequence can be undone
+    ActionSequence *sequence = new ActionSequence();
+    CPPUNIT_ASSERT_EQUAL( true, sequence->canUndo() );
+    // if only a positive action is contained it can be undone
+    sequence->addAction(positive1);
+    CPPUNIT_ASSERT_EQUAL( true, sequence->canUndo() );
+    // the single negative action should block the process
+    sequence->addAction(negative1);
+    CPPUNIT_ASSERT_EQUAL( false, sequence->canUndo() );
+    // after removing the negative action all is well again
+    sequence->removeLastAction();
+    CPPUNIT_ASSERT_EQUAL( true, sequence->canUndo() );
+    delete sequence;
+  }
+
+  delete positive1;
+  delete positive2;
+  delete negative1;
+  delete negative2;
+
+}
+
+
+/********************************************** Main routine **************************************/
+
+int main(int argc, char **argv)
+{
+  // Get the top level suite from the registry
+  CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
+
+  // Adds the test to the list of test to run
+  CppUnit::TextUi::TestRunner runner;
+  runner.addTest( suite );
+
+  // Change the default outputter to a compiler error format outputter
+  runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),
+                                                       std::cerr ) );
+  // Run the tests.
+  bool wasSucessful = runner.run();
+
+  // Return error code 1 if the one of test failed.
+  return wasSucessful ? 0 : 1;
+};
Index: src/unittests/ActionSequenceTest.hpp
===================================================================
--- src/unittests/ActionSequenceTest.hpp	(revision 1473396142bb336f3624ec2b15023c20cfe170ea)
+++ src/unittests/ActionSequenceTest.hpp	(revision 1473396142bb336f3624ec2b15023c20cfe170ea)
@@ -0,0 +1,26 @@
+/*
+ * ActionSequenzTest.hpp
+ *
+ *  Created on: Dec 17, 2009
+ *      Author: crueger
+ */
+
+#ifndef ACTIONSEQUENZTEST_HPP_
+#define ACTIONSEQUENZTEST_HPP_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class ActionSequenceTest :  public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( ActionSequenceTest) ;
+  CPPUNIT_TEST ( canUndoTest );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void canUndoTest();
+};
+
+#endif /* ACTIONSEQUENZTEST_HPP_ */
Index: src/unittests/Makefile.am
===================================================================
--- src/unittests/Makefile.am	(revision 8166250ffff8b35d39b69b5f4f1dbd9d2d9f4aec)
+++ src/unittests/Makefile.am	(revision 1473396142bb336f3624ec2b15023c20cfe170ea)
@@ -4,5 +4,7 @@
 AM_CXXFLAGS = $(CPPUNIT_CFLAGS)
 
-TESTS = ActOnAllUnitTest AnalysisBondsUnitTests AnalysisCorrelationToPointUnitTest AnalysisCorrelationToSurfaceUnitTest AnalysisPairCorrelationUnitTest BondGraphUnitTest ListOfBondsUnitTest LogUnitTest MemoryUsageObserverUnitTest MemoryAllocatorUnitTest StackClassUnitTest VectorUnitTest
+MENUTESTS = ActionSequenceTest
+
+TESTS = ActOnAllUnitTest AnalysisBondsUnitTests AnalysisCorrelationToPointUnitTest AnalysisCorrelationToSurfaceUnitTest AnalysisPairCorrelationUnitTest BondGraphUnitTest ListOfBondsUnitTest LogUnitTest MemoryUsageObserverUnitTest MemoryAllocatorUnitTest StackClassUnitTest VectorUnitTest ${MENUTESTS}
 check_PROGRAMS = $(TESTS)
 noinst_PROGRAMS = $(TESTS)
@@ -44,4 +46,6 @@
 VectorUnitTest_LDADD = ../libmolecuilder.a
 
+ActionSequenceTest_SOURCES = ActionSequenceTest.cpp ActionSequenceTest.hpp
+ActionSequenceTest_LDADD = ../libmolecuilder.a
 
 #AUTOMAKE_OPTIONS = parallel-tests
