Index: src/Parameters/unittests/Makefile.am
===================================================================
--- src/Parameters/unittests/Makefile.am	(revision a696f954e940fe89f7d674465bc359bb6d856bb5)
+++ src/Parameters/unittests/Makefile.am	(revision 4892c3a75ac834100d71aa805116f271177d67d5)
@@ -7,5 +7,6 @@
 	../Parameters/unittests/ContinuousParameterTest.cpp \
 	../Parameters/unittests/DiscreteValueTest.cpp \
-	../Parameters/unittests/DiscreteParameterTest.cpp
+	../Parameters/unittests/DiscreteParameterTest.cpp \
+	../Parameters/unittests/ValueTest.cpp
 
 PARAMETERSTESTSHEADERS = \
@@ -13,5 +14,6 @@
 	../Parameters/unittests/ContinuousParameterTest.hpp \
 	../Parameters/unittests/DiscreteValueTest.hpp \
-	../Parameters/unittests/DiscreteParameterTest.hpp
+	../Parameters/unittests/DiscreteParameterTest.hpp \
+	../Parameters/unittests/ValueTest.hpp
 
 PARAMETERSTESTS = \
@@ -19,5 +21,6 @@
 	ContinuousParameterTest \
 	DiscreteValueTest \
-	DiscreteParameterTest
+	DiscreteParameterTest \
+	ValueTest
 
 TESTS += $(PARAMETERSTESTS)
@@ -85,4 +88,15 @@
 DiscreteParameterTest_LDADD = \
 	$(PARAMETERSLIBS)
+
+
+ValueTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Parameters/unittests/ValueTest.cpp \
+	../Parameters/unittests/ValueTest.hpp \
+	../Parameters/Value.hpp \
+	../Parameters/Value_impl.hpp \
+	../Parameters/ValueInterface.hpp
+ContinuousValueTest_LDADD = \
+	$(PARAMETERSLIBS) \
+	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la
  
  
Index: src/Parameters/unittests/ValueTest.cpp
===================================================================
--- src/Parameters/unittests/ValueTest.cpp	(revision 4892c3a75ac834100d71aa805116f271177d67d5)
+++ src/Parameters/unittests/ValueTest.cpp	(revision 4892c3a75ac834100d71aa805116f271177d67d5)
@@ -0,0 +1,192 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * ValueTest.cpp
+ *
+ *  Created on: Apr 13, 2012
+ *      Author: ankele
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "ValueTest.hpp"
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "Parameters/Value.hpp"
+#include "Parameters/Validators/DiscreteValidator.hpp"
+#include "Parameters/Validators/DummyValidator.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+using namespace std;
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( ValueTest );
+
+
+void ValueTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+
+  for (int i=1; i<=3;++i) {
+    ValidValues.push_back(i);
+  }
+}
+
+void ValueTest::tearDown()
+{
+  ValidValues.clear();
+}
+
+/************************************ tests ***********************************/
+
+
+/** Unit test for isValid.
+ *
+ */
+void ValueTest::isValidTest()
+{
+  // create instance
+  Value<int> test(ValidValues);
+
+  // checking valid values
+  for (int i=1; i<=3;++i)
+    CPPUNIT_ASSERT_EQUAL(true, test.isValid(i));
+
+  // checking invalid values
+  for (int i=-10; i<=0;++i)
+    CPPUNIT_ASSERT_EQUAL(false, test.isValid(i));
+  for (int i=4; i<=0;++i)
+    CPPUNIT_ASSERT_EQUAL(false, test.isValid(i));
+}
+
+/** Unit test for appendValidValue.
+ *
+ */
+void ValueTest::appendValidValueTest()
+{
+  // create instance
+/*  Value<int> test(ValidValues);
+
+  // adding values 4,5,6
+  for (int i=4; i<=6;++i) {
+    CPPUNIT_ASSERT_EQUAL(false, test.isValidValue(i));
+    test.appendValidValue(i);
+    CPPUNIT_ASSERT_EQUAL(true, test.isValidValue(i));
+  }
+
+  // adding same value, throws assertion
+  const size_t size_before = test.ValidValues.size();
+#ifndef NDEBUG
+  std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
+  for (int i=1; i<=6;++i)
+    CPPUNIT_ASSERT_THROW(test.appendValidValue(i), Assert::AssertionFailure);
+#endif
+  CPPUNIT_ASSERT_EQUAL( size_before, test.ValidValues.size() );
+
+  // checking valid values
+  for (int i=1; i<=6;++i)
+    CPPUNIT_ASSERT_EQUAL(true, test.isValidValue(i));
+
+  // checking invalid values
+  for (int i=-10; i<=0;++i)
+    CPPUNIT_ASSERT_EQUAL(false, test.isValidValue(i));
+
+  // checking invalid values
+  for (int i=7; i<=10;++i)
+    CPPUNIT_ASSERT_EQUAL(false, test.isValidValue(i));*/
+}
+
+/** Unit test for setters and getters.
+ *
+ */
+void ValueTest::settergetterTest()
+{
+  // create instance
+  Value<int> test(ValidValues);
+
+  // unset calling of get, throws
+#ifndef NDEBUG
+  std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
+  CPPUNIT_ASSERT_THROW(test.get(), Assert::AssertionFailure);
+#endif
+
+  // setting invalid, throws
+#ifndef NDEBUG
+  std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
+  CPPUNIT_ASSERT_THROW(test.set(4), Assert::AssertionFailure);
+#endif
+#ifndef NDEBUG
+  std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
+  CPPUNIT_ASSERT_THROW(test.set(0), Assert::AssertionFailure);
+#endif
+
+  // checking all valid ones
+  for (int i=1; i<=3;++i) {
+    test.set(i);
+    CPPUNIT_ASSERT_EQUAL(i, test.get());
+  }
+
+}
+
+/** Unit test for comparator.
+ *
+ */
+void ValueTest::comparatorTest()
+{
+  {
+    // create instance
+    Value<int> test(ValidValues);
+    Value<int> instance(ValidValues);
+    test.set(1);
+    instance.set(1);
+
+    // same value, same range
+    {
+      CPPUNIT_ASSERT(test == instance);
+    }
+
+    // different value, same range
+    {
+      const int oldvalue = instance.get();
+      instance.set(2);
+      CPPUNIT_ASSERT(test != instance);
+      instance.set(oldvalue);
+    }
+  }
+  {
+    Value<int> test(ValidValues);
+    Value<int> instance(ValidValues);
+//    instance.appendValidValue(4); TODO
+
+    test.set(1);
+    instance.set(1);
+
+    // same value, same range
+    {
+      //CPPUNIT_ASSERT(test != instance);
+    }
+
+    // different value, same range
+    {
+      const int oldvalue = instance.get();
+      instance.set(2);
+      CPPUNIT_ASSERT(test != instance);
+      instance.set(oldvalue);
+    }
+  }
+}
Index: src/Parameters/unittests/ValueTest.hpp
===================================================================
--- src/Parameters/unittests/ValueTest.hpp	(revision 4892c3a75ac834100d71aa805116f271177d67d5)
+++ src/Parameters/unittests/ValueTest.hpp	(revision 4892c3a75ac834100d71aa805116f271177d67d5)
@@ -0,0 +1,41 @@
+/*
+ * ValueTest.hpp
+ *
+ *  Created on: Apr 13, 2012
+ *      Author: ankele
+ */
+#ifndef DISCRETEVALUETEST_HPP_
+#define DISCRETEVALUETEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <vector>
+
+class ValueTest :  public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE( ValueTest ) ;
+  CPPUNIT_TEST ( isValidTest );
+  CPPUNIT_TEST ( appendValidValueTest );
+  CPPUNIT_TEST ( settergetterTest );
+  CPPUNIT_TEST ( comparatorTest );
+  CPPUNIT_TEST_SUITE_END();
+
+public:
+  void setUp();
+  void tearDown();
+
+  void isValidTest();
+  void appendValidValueTest();
+  void settergetterTest();
+  void comparatorTest();
+
+private:
+  std::vector<int> ValidValues;
+};
+
+#endif /* DISCRETEVALUETEST_HPP_ */
