Index: /trunk/sources/HeuristicLab.Algorithms.SGA/3.3/Tests/UnitTest.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.SGA/3.3/Tests/UnitTest.cs	(revision 2949)
+++ /trunk/sources/HeuristicLab.Algorithms.SGA/3.3/Tests/UnitTest.cs	(revision 2950)
@@ -27,5 +27,5 @@
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 
-namespace HeuristicLab.Algorithms.SGA.Tests {
+namespace HeuristicLab.Algorithms.SGA_33.Tests {
   /// <summary>
   /// Summary description for UnitTest
Index: /trunk/sources/HeuristicLab.Persistence/3.3/Tests/AuthoringTests.txt
===================================================================
--- /trunk/sources/HeuristicLab.Persistence/3.3/Tests/AuthoringTests.txt	(revision 2950)
+++ /trunk/sources/HeuristicLab.Persistence/3.3/Tests/AuthoringTests.txt	(revision 2950)
@@ -0,0 +1,136 @@
+﻿==========================================================================
+    Visual Studio Team System: Overview of Authoring and Running Tests    
+==========================================================================
+
+This overview describes the features for authoring and running tests in 
+Visual Studio Team System and Visual Studio Team Edition for Software Testers.
+
+Opening Tests
+-------------
+To open a test, open a test project or a test metadata file (a file with
+extension .vsmdi) that contains the definition of the test. You can find
+test projects and metadata files in Solution Explorer.
+
+Viewing Tests
+-------------
+To see which tests are available to you, open the Test View window. Or,
+if you have installed Team Edition for Software Testers, you can also open
+the Test List Editor window to view tests.
+
+To open the Test View window, click the Test menu, point to Windows, and
+then click Test View. To open the Test List Editor window (if you have
+installed Team Edition for Software Testers), click Test, point to Windows,
+and then click Test List Editor.
+
+Running Tests
+-------------
+You can run tests from the Test View window and the Test List Editor window.
+See Viewing Tests to learn how to open these windows. To run one or more
+tests displayed in the Test View window, first select the tests in that
+window; to select multiple tests, hold either the Shift or CTRL key while
+clicking tests. Then click the Run Tests button in the Test View window
+toolbar.
+
+If you have installed Visual Studio Team Edition for Software Testers, you can
+also use the Test List Editor window to run tests. To run tests in Test List Editor,
+select the check box next to each test that you want to run. Then click the
+Run Tests button in the Test List Editor window toolbar.
+
+Viewing Test Results
+--------------------
+When you run a test or a series of tests, the results of the test run will be
+shown in the Test Results window. Each individual test in the run is shown on
+a separate line so that you can see its status. The window contains an
+embedded status bar in the top half of the window that provides you with
+summary details of the complete test run.
+
+To see more detailed results for a particular test result, double-click it in
+the Test Results window. This opens a window that provides more information
+about the particular test result, such as any specific error messages returned
+by the test.
+
+Changing the way that tests are run
+-----------------------------------
+Each time you run one or more tests, a collection of settings is used to
+determine how those tests are run. These settings are contained in a “test
+run configuration” file.
+
+Here is a partial list of the changes you can make with a test run 
+configuration file:
+
+ - Change the naming scheme for each test run.
+ - Change the test controller that the tests are run on so that you can run
+   tests remotely.
+ - Gather code coverage data for the code being tested so that you can see
+   which lines of code are covered by your tests.
+ - Enable and disable test deployment. 
+ - Specify additional files to deploy before tests are run.
+ - Select a different host, ASP.NET, for running ASP.NET unit tests.
+ - Select a different host, the smart device test host, for running smart device unit tests.
+ - Set various properties for the test agents that run your tests.
+ - Run custom scripts at the start and end of each test run so that you can
+   set up the test environment exactly as required each time tests are run.
+ - Set time limits for tests and test runs.
+ - Set the browser mix and the number of times to repeat Web tests in the
+   test run.
+
+By default, a test run configuration file is created whenever you create a
+new test project. You make changes to this file by double-clicking it in 
+Solution Explorer and then changing its settings. (Test run configuration
+files have the extension .testrunconfig.)
+
+A solution can contain multiple test run configuration files. Only one of
+those files, known as the “Active” test run configuration file, is used to
+determine the settings that are currently used for test runs. You select
+the active test run configuration by clicking Select Active Test Run 
+Configuration on the Test menu.
+
+-------------------------------------------------------------------------------
+
+Test Types
+----------
+Using Visual Studio Team Edition for Software Testers, you can create a number
+of different test types:
+
+Unit test: Use a unit test to create a programmatic test in C++, Visual C# or
+Visual Basic that exercises source code. A unit test calls the methods of a
+class, passing suitable parameters, and verifies that the returned value is
+what you expect.
+There are three specialized variants of unit tests:
+ - Data-driven unit tests are created when you configure a unit test to be
+   called repeatedly for each row of a data source. The data from each row
+   is used by the unit test as input data.
+ - ASP.NET unit tests are unit tests that exercise code in an ASP.NET Web
+   application.
+ - Smart device unit tests are unit tests that are deployed to a smart device
+   or emulator and then executed by the smart device test host.  
+
+Web Test: Web tests consist of an ordered series of HTTP requests that you
+record in a browser session using Microsoft Internet Explorer. You can have
+the test report specific details about the pages or sites it requests, such
+as whether a particular page contains a specified string.
+
+Load Test: You use a load test to encapsulate non-manual tests, such as
+unit, Web, and generic tests, and then run them simultaneously by using
+virtual users. Running these tests under load generates test results,
+including performance and other counters, in tables and in graphs.
+
+Generic test: A generic test is an existing program wrapped to function as a
+test in Visual Studio. The following are examples of tests or programs that
+you can turn into generic tests:
+ - An existing test that uses process exit codes to communicate whether the
+   test passed or failed. 0 indicates passing and any other value indicates
+   a failure.
+ - A general program to obtain specific functionality during a test scenario.
+ - A test or program that uses a special XML file (called a “summary results
+   file”), to communicate detailed results.
+
+Manual test: The manual test type is used when the test tasks are to be
+completed by a test engineer as opposed to an automated script.
+
+Ordered test: Use an ordered test to execute a set of tests in an order you
+specify.
+
+-------------------------------------------------------------------------------
+
+
Index: /trunk/sources/HeuristicLab.Persistence/3.3/Tests/HeuristicLab.Persistence.UnitTest.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Persistence/3.3/Tests/HeuristicLab.Persistence.UnitTest.csproj	(revision 2950)
+++ /trunk/sources/HeuristicLab.Persistence/3.3/Tests/HeuristicLab.Persistence.UnitTest.csproj	(revision 2950)
@@ -0,0 +1,95 @@
+﻿<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{BF7D9494-A586-457B-8DF9-ED599F9E6A71}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Persistence.UnitTest</RootNamespace>
+    <AssemblyName>HeuristicLab.Persistence.UnitTest</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="StorableAttributeTests.cs" />
+    <Compile Include="UseCases.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="AuthoringTests.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\3.3\HeuristicLab.Persistence-3.3.csproj">
+      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
+      <Name>HeuristicLab.Persistence-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /trunk/sources/HeuristicLab.Persistence/3.3/Tests/Properties/AssemblyInfo.cs
===================================================================
--- /trunk/sources/HeuristicLab.Persistence/3.3/Tests/Properties/AssemblyInfo.cs	(revision 2950)
+++ /trunk/sources/HeuristicLab.Persistence/3.3/Tests/Properties/AssemblyInfo.cs	(revision 2950)
@@ -0,0 +1,35 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Persistence.UnitTest")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("HeuristicLab.Persistence.UnitTest")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM componenets.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("32f68a5e-6be7-41f5-a5d1-debcfdebba09")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: /trunk/sources/HeuristicLab.Persistence/3.3/Tests/StorableAttributeTests.cs
===================================================================
--- /trunk/sources/HeuristicLab.Persistence/3.3/Tests/StorableAttributeTests.cs	(revision 2950)
+++ /trunk/sources/HeuristicLab.Persistence/3.3/Tests/StorableAttributeTests.cs	(revision 2950)
@@ -0,0 +1,92 @@
+﻿using System;
+using System.Collections.Generic;
+using HeuristicLab.Persistence.Core;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System.Reflection;
+
+namespace HeuristicLab.Persistence.Test {
+
+  class DemoClass {
+
+    [Storable(Name = "TestProperty", DefaultValue = 12)]
+    public object o;
+
+    [Storable]
+    public int x = 2;
+
+    public int y;
+
+  }
+
+  class Base {
+    public string baseName;
+    [Storable]
+    public virtual string Name {
+      get { return "Base"; }
+      set { baseName = value; }
+    }
+  }
+
+  class Override : Base {
+    [Storable]
+    public override string Name {
+      get { return "Override"; }
+      set { base.Name = value; }
+    }
+  }
+
+  [EmptyStorableClass]
+  class Intermediate : Override {
+  }
+
+  class New : Intermediate {
+    public string newName;
+    [Storable]
+    public new string Name {
+      get { return "New"; }
+      set { newName = value; }
+    }
+  }
+
+  [TestClass]
+  public class AttributeTest {
+
+    [TestMethod]
+    public void SimpleStorableAttributeTest() {
+      DemoClass t = new DemoClass();
+      IEnumerable<DataMemberAccessor> accessorList = StorableAttribute.GetStorableAccessors(t);
+      Dictionary<string, DataMemberAccessor> accessors = new Dictionary<string, DataMemberAccessor>();
+      foreach (var a in accessorList)
+        accessors.Add(a.Name, a);
+      Assert.IsTrue(accessors.ContainsKey("TestProperty"));
+      Assert.IsTrue(accessors.ContainsKey("x"));
+      Assert.IsFalse(accessors.ContainsKey("y"));
+      object o = new object();
+      t.o = o;
+      Assert.AreSame(accessors["TestProperty"].Get(), o);
+      t.x = 12;
+      Assert.AreEqual(accessors["x"].Get(), 12);
+      t.y = 312890;
+      accessors["TestProperty"].Set(null);
+      Assert.IsNull(t.o);
+      accessors["x"].Set(123);
+      Assert.AreEqual(t.x, 123);
+    }
+
+    [TestMethod]
+    public void TestInheritance() {
+      New n = new New();
+      var accessors = StorableAttribute.GetStorableAccessors(n);
+      var accessDict = new Dictionary<string, DataMemberAccessor>();
+      foreach (var accessor in accessors) // assert uniqueness
+        accessDict.Add(accessor.Name, accessor);
+      Assert.IsTrue(accessDict.ContainsKey(typeof(New).FullName + ".Name"));
+      Assert.IsTrue(accessDict.ContainsKey(typeof(Override).FullName + ".Name"));
+      Assert.AreEqual("New", accessDict[typeof(New).FullName + ".Name"].Get());
+      Assert.AreEqual("Override", accessDict[typeof(Override).FullName + ".Name"].Get());
+    }
+
+  }
+
+}
Index: /trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs
===================================================================
--- /trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs	(revision 2950)
+++ /trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs	(revision 2950)
@@ -0,0 +1,667 @@
+﻿using System;
+using System.Text;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using HeuristicLab.Persistence.Core;
+using System.Collections;
+using HeuristicLab.Persistence.Default.Xml;
+using HeuristicLab.Persistence.Default.DebugString;
+using System.IO;
+using System.Reflection;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Persistence.Interfaces;
+using HeuristicLab.Persistence.Default.Xml.Primitive;
+using HeuristicLab.Persistence.Default.CompositeSerializers;
+using HeuristicLab.Persistence.Auxiliary;
+using System.Text.RegularExpressions;
+using HeuristicLab.Persistence.Test;
+using System.Drawing;
+using System.Drawing.Imaging;
+
+namespace HeuristicLab.Persistence.UnitTest {
+
+  public class NumberTest {
+    [Storable]
+    private bool _bool = true;
+    [Storable]
+    private byte _byte = 0xFF;
+    [Storable]
+    private sbyte _sbyte = 0xF;
+    [Storable]
+    private short _short = -123;
+    [Storable]
+    private ushort _ushort = 123;
+    [Storable]
+    private int _int = -123;
+    [Storable]
+    private uint _uint = 123;
+    [Storable]
+    private long _long = 123456;
+    [Storable]
+    private ulong _ulong = 123456;
+  }
+
+  public class NonDefaultConstructorClass {
+    [Storable]
+    int value;
+    public NonDefaultConstructorClass(int value) {
+      this.value = value;
+    }
+  }
+
+  public class IntWrapper {
+
+    [Storable]
+    public int Value;
+
+    private IntWrapper() { }
+
+    public IntWrapper(int value) {
+      this.Value = value;
+    }
+
+    public override bool Equals(object obj) {
+      if (obj as IntWrapper == null)
+        return false;
+      return Value.Equals(((IntWrapper)obj).Value);
+    }
+    public override int GetHashCode() {
+      return Value.GetHashCode();
+    }
+
+  }
+
+  public class PrimitivesTest : NumberTest {
+    [Storable]
+    private char c = 'e';
+    [Storable]
+    private long[,] _long_array =
+      new long[,] { { 123, 456, }, { 789, 123 } };
+    [Storable]
+    public List<int> list = new List<int> { 1, 2, 3, 4, 5 };
+    [Storable]
+    private object o = new object();
+  }
+
+  public enum TestEnum { va1, va2, va3, va8 } ;
+
+  public class RootBase {
+    [Storable]
+    private string baseString = "   Serial  ";
+    [Storable]
+    public TestEnum myEnum = TestEnum.va3;
+  }
+
+  public class Root : RootBase {
+    [Storable]
+    public Stack<int> intStack = new Stack<int>();
+    [Storable]
+    public int[] i = new[] { 3, 4, 5, 6 };
+    [Storable(Name = "Test String")]
+    public string s;
+    [Storable]
+    public ArrayList intArray = new ArrayList(new[] { 1, 2, 3 });
+    [Storable]
+    public List<int> intList = new List<int>(new[] { 321, 312, 321 });
+    [Storable]
+    public Custom c;
+    [Storable]
+    public List<Root> selfReferences;
+    [Storable]
+    public double[,] multiDimArray = new double[,] { { 1, 2, 3 }, { 3, 4, 5 } };
+    [Storable]
+    public bool boolean = true;
+    [Storable]
+    public DateTime dateTime;
+    [Storable]
+    public KeyValuePair<string, int> kvp = new KeyValuePair<string, int>("Serial", 123);
+    [Storable]
+    public Dictionary<string, int> dict = new Dictionary<string, int>();
+    [Storable(DefaultValue = "default")]
+    public string uninitialized;
+  }
+
+  public enum SimpleEnum { one, two, three }
+  public enum ComplexEnum { one = 1, two = 2, three = 3 }
+  [FlagsAttribute]
+  public enum TrickyEnum { zero = 0, one = 1, two = 2 }
+
+  public class EnumTest {
+    [Storable]
+    public SimpleEnum simpleEnum = SimpleEnum.one;
+    [Storable]
+    public ComplexEnum complexEnum = (ComplexEnum)2;
+    [Storable]
+    public TrickyEnum trickyEnum = (TrickyEnum)15;
+  }
+
+  public class Custom {
+    [Storable]
+    public int i;
+    [Storable]
+    public Root r;
+    [Storable]
+    public string name = "<![CDATA[<![CDATA[Serial]]>]]>";
+  }
+
+  public class Manager {
+
+    public DateTime lastLoadTime;
+    [Storable]
+    private DateTime lastLoadTimePersistence {
+      get { return lastLoadTime; }
+      set { lastLoadTime = DateTime.Now; }
+    }
+    [Storable]
+    public double? dbl;
+  }
+
+  public class C {
+    [Storable]
+    public C[][] allCs;
+    [Storable]
+    public KeyValuePair<List<C>, C> kvpList;
+  }
+
+  public class NonSerializable {
+    int x;
+  }
+
+
+  [TestClass]
+  public class UseCases {
+
+    private string tempFile;
+
+    [TestInitialize()]
+    public void CreateTempFile() {
+      tempFile = Path.GetTempFileName();
+    }
+
+    [TestCleanup()]
+    public void ClearTempFile() {
+      StreamReader reader = new StreamReader(tempFile);
+      string s = reader.ReadToEnd();
+      reader.Close();
+      File.Delete(tempFile);
+    }
+
+    [TestMethod]
+    public void ComplexStorable() {
+      Root r = new Root();
+      r.intStack.Push(1);
+      r.intStack.Push(2);
+      r.intStack.Push(3);
+      r.selfReferences = new List<Root> { r, r };
+      r.c = new Custom { r = r };
+      r.dict.Add("one", 1);
+      r.dict.Add("two", 2);
+      r.dict.Add("three", 3);
+      r.myEnum = TestEnum.va1;
+      r.i = new[] { 7, 5, 6 };
+      r.s = "new value";
+      r.intArray = new ArrayList { 3, 2, 1 };
+      r.intList = new List<int> { 9, 8, 7 };
+      r.multiDimArray = new double[,] { { 5, 4, 3 }, { 1, 4, 6 } };
+      r.boolean = false;
+      r.dateTime = DateTime.Now;
+      r.kvp = new KeyValuePair<string, int>("string key", 321);
+      r.uninitialized = null;
+      XmlGenerator.Serialize(r, tempFile);
+      Root newR = (Root)XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(r),
+        DebugStringGenerator.Serialize(newR));
+      Assert.AreSame(newR, newR.selfReferences[0]);
+      Assert.AreNotSame(r, newR);
+      Assert.AreEqual(r.myEnum, TestEnum.va1);
+      Assert.AreEqual(r.i[0], 7);
+      Assert.AreEqual(r.i[1], 5);
+      Assert.AreEqual(r.i[2], 6);
+      Assert.AreEqual(r.s, "new value");
+      Assert.AreEqual(r.intArray[0], 3);
+      Assert.AreEqual(r.intArray[1], 2);
+      Assert.AreEqual(r.intArray[2], 1);
+      Assert.AreEqual(r.intList[0], 9);
+      Assert.AreEqual(r.intList[1], 8);
+      Assert.AreEqual(r.intList[2], 7);
+      Assert.AreEqual(r.multiDimArray[0, 0], 5);
+      Assert.AreEqual(r.multiDimArray[0, 1], 4);
+      Assert.AreEqual(r.multiDimArray[0, 2], 3);
+      Assert.AreEqual(r.multiDimArray[1, 0], 1);
+      Assert.AreEqual(r.multiDimArray[1, 1], 4);
+      Assert.AreEqual(r.multiDimArray[1, 2], 6);
+      Assert.IsFalse(r.boolean);
+      Assert.IsTrue((DateTime.Now - r.dateTime).TotalSeconds < 10);
+      Assert.AreEqual(r.kvp.Key, "string key");
+      Assert.AreEqual(r.kvp.Value, 321);
+      Assert.IsNull(r.uninitialized);
+      Assert.AreEqual(newR.myEnum, TestEnum.va1);
+      Assert.AreEqual(newR.i[0], 7);
+      Assert.AreEqual(newR.i[1], 5);
+      Assert.AreEqual(newR.i[2], 6);
+      Assert.AreEqual(newR.s, "new value");
+      Assert.AreEqual(newR.intArray[0], 3);
+      Assert.AreEqual(newR.intArray[1], 2);
+      Assert.AreEqual(newR.intArray[2], 1);
+      Assert.AreEqual(newR.intList[0], 9);
+      Assert.AreEqual(newR.intList[1], 8);
+      Assert.AreEqual(newR.intList[2], 7);
+      Assert.AreEqual(newR.multiDimArray[0, 0], 5);
+      Assert.AreEqual(newR.multiDimArray[0, 1], 4);
+      Assert.AreEqual(newR.multiDimArray[0, 2], 3);
+      Assert.AreEqual(newR.multiDimArray[1, 0], 1);
+      Assert.AreEqual(newR.multiDimArray[1, 1], 4);
+      Assert.AreEqual(newR.multiDimArray[1, 2], 6);
+      Assert.AreEqual(newR.intStack.Pop(), 3);
+      Assert.AreEqual(newR.intStack.Pop(), 2);
+      Assert.AreEqual(newR.intStack.Pop(), 1);
+      Assert.IsFalse(newR.boolean);
+      Assert.IsTrue((DateTime.Now - newR.dateTime).TotalSeconds < 10);
+      Assert.AreEqual(newR.kvp.Key, "string key");
+      Assert.AreEqual(newR.kvp.Value, 321);
+      Assert.IsNull(newR.uninitialized);
+    }
+
+    [TestMethod]
+    public void SelfReferences() {
+      C c = new C();
+      C[][] cs = new C[2][];
+      cs[0] = new C[] { c };
+      cs[1] = new C[] { c };
+      c.allCs = cs;
+      c.kvpList = new KeyValuePair<List<C>, C>(new List<C> { c }, c);
+      XmlGenerator.Serialize(cs, tempFile);
+      object o = XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(cs),
+        DebugStringGenerator.Serialize(o));
+      Assert.AreSame(c, c.allCs[0][0]);
+      Assert.AreSame(c, c.allCs[1][0]);
+      Assert.AreSame(c, c.kvpList.Key[0]);
+      Assert.AreSame(c, c.kvpList.Value);
+      C[][] newCs = (C[][])o;
+      C newC = newCs[0][0];
+      Assert.AreSame(newC, newC.allCs[0][0]);
+      Assert.AreSame(newC, newC.allCs[1][0]);
+      Assert.AreSame(newC, newC.kvpList.Key[0]);
+      Assert.AreSame(newC, newC.kvpList.Value);
+    }
+
+    [TestMethod]
+    public void ArrayCreation() {
+      ArrayList[] arrayListArray = new ArrayList[4];
+      arrayListArray[0] = new ArrayList();
+      arrayListArray[0].Add(arrayListArray);
+      arrayListArray[0].Add(arrayListArray);
+      arrayListArray[1] = new ArrayList();
+      arrayListArray[1].Add(arrayListArray);
+      arrayListArray[2] = new ArrayList();
+      arrayListArray[2].Add(arrayListArray);
+      arrayListArray[2].Add(arrayListArray);
+      Array a = Array.CreateInstance(
+                              typeof(object),
+                              new[] { 1, 2 }, new[] { 3, 4 });
+      arrayListArray[2].Add(a);
+      XmlGenerator.Serialize(arrayListArray, tempFile);
+      object o = XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(arrayListArray),
+        DebugStringGenerator.Serialize(o));
+      ArrayList[] newArray = (ArrayList[])o;
+      Assert.AreSame(arrayListArray, arrayListArray[0][0]);
+      Assert.AreSame(arrayListArray, arrayListArray[2][1]);
+      Assert.AreSame(newArray, newArray[0][0]);
+      Assert.AreSame(newArray, newArray[2][1]);
+    }
+
+    [TestMethod]
+    public void CustomSerializationProperty() {
+      Manager m = new Manager();
+      XmlGenerator.Serialize(m, tempFile);
+      Manager newM = (Manager)XmlParser.Deserialize(tempFile);
+      Assert.AreNotEqual(
+        DebugStringGenerator.Serialize(m),
+        DebugStringGenerator.Serialize(newM));
+      Assert.AreEqual(m.dbl, newM.dbl);
+      Assert.AreEqual(m.lastLoadTime, new DateTime());
+      Assert.AreNotEqual(newM.lastLoadTime, new DateTime());
+      Assert.IsTrue((DateTime.Now - newM.lastLoadTime).TotalSeconds < 10);
+    }
+
+    [TestMethod]
+    public void Primitives() {
+      PrimitivesTest sdt = new PrimitivesTest();
+      XmlGenerator.Serialize(sdt, tempFile);
+      object o = XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(sdt),
+        DebugStringGenerator.Serialize(o));
+    }
+
+    [TestMethod]
+    public void MultiDimensionalArray() {
+      string[,] mDimString = new string[,] {
+        {"ora", "et", "labora"},
+        {"Beten", "und", "Arbeiten"}
+      };
+      XmlGenerator.Serialize(mDimString, tempFile);
+      object o = XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(mDimString),
+        DebugStringGenerator.Serialize(o));
+    }
+
+    public class NestedType {
+      [Storable]
+      private string value = "value";
+    }
+
+    [TestMethod]
+    public void NestedTypeTest() {
+      NestedType t = new NestedType();
+      XmlGenerator.Serialize(t, tempFile);
+      object o = XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(t),
+        DebugStringGenerator.Serialize(o));
+    }
+
+
+    [TestMethod]
+    public void SimpleArray() {
+      string[] strings = { "ora", "et", "labora" };
+      XmlGenerator.Serialize(strings, tempFile);
+      object o = XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(strings),
+        DebugStringGenerator.Serialize(o));
+    }
+
+    [TestMethod]
+    public void PrimitiveRoot() {
+      XmlGenerator.Serialize(12.3f, tempFile);
+      object o = XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(12.3f),
+        DebugStringGenerator.Serialize(o));
+    }
+
+    private string formatFullMemberName(MemberInfo mi) {
+      return new StringBuilder()
+        .Append(mi.DeclaringType.Assembly.GetName().Name)
+        .Append(": ")
+        .Append(mi.DeclaringType.Namespace)
+        .Append('.')
+        .Append(mi.DeclaringType.Name)
+        .Append('.')
+        .Append(mi.Name).ToString();
+    }
+
+    [TestMethod]
+    public void CodingConventions() {
+      List<string> lowerCaseMethodNames = new List<string>();
+      List<string> lowerCaseProperties = new List<string>();
+      List<string> lowerCaseFields = new List<string>();
+      foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) {
+        if (!a.GetName().Name.StartsWith("HeuristicLab"))
+          continue;
+        foreach (Type t in a.GetTypes()) {
+          foreach (MemberInfo mi in t.GetMembers(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static)) {
+            if (mi.DeclaringType.Name.StartsWith("<>"))
+              continue;
+            if (char.IsLower(mi.Name[0])) {
+              if (mi.MemberType == MemberTypes.Field)
+                lowerCaseFields.Add(formatFullMemberName(mi));
+              if (mi.MemberType == MemberTypes.Property)
+                lowerCaseProperties.Add(formatFullMemberName(mi));
+              if (mi.MemberType == MemberTypes.Method &&
+                !mi.Name.StartsWith("get_") &&
+                !mi.Name.StartsWith("set_") &&
+                !mi.Name.StartsWith("add_") &&
+                !mi.Name.StartsWith("remove_"))
+                lowerCaseMethodNames.Add(formatFullMemberName(mi));
+            }
+          }
+        }
+      }
+      //Assert.AreEqual("", lowerCaseFields.Aggregate("", (a, b) => a + "\r\n" + b));
+      Assert.AreEqual("", lowerCaseMethodNames.Aggregate("", (a, b) => a + "\r\n" + b));
+      Assert.AreEqual("", lowerCaseProperties.Aggregate("", (a, b) => a + "\r\n" + b));
+    }
+
+    [TestMethod]
+    public void Number2StringDecomposer() {
+      NumberTest sdt = new NumberTest();
+      XmlGenerator.Serialize(sdt, tempFile,
+        new Configuration(new XmlFormat(),
+          new List<IPrimitiveSerializer> { new String2XmlSerializer() },
+          new List<ICompositeSerializer> { 
+            new StorableSerializer(),
+            new Number2StringSerializer() }));
+      object o = XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(
+        DebugStringGenerator.Serialize(sdt),
+        DebugStringGenerator.Serialize(o));
+    }
+
+    [TestMethod]
+    public void Enums() {
+      EnumTest et = new EnumTest();
+      et.simpleEnum = SimpleEnum.two;
+      et.complexEnum = ComplexEnum.three;
+      et.trickyEnum = TrickyEnum.two | TrickyEnum.one;
+      XmlGenerator.Serialize(et, tempFile);
+      EnumTest newEt = (EnumTest)XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(et.simpleEnum, SimpleEnum.two);
+      Assert.AreEqual(et.complexEnum, ComplexEnum.three);
+      Assert.AreEqual(et.trickyEnum, (TrickyEnum)3);
+    }
+
+    [TestMethod]
+    public void TestAliasingWithOverriddenEquals() {
+      List<IntWrapper> ints = new List<IntWrapper>();
+      ints.Add(new IntWrapper(1));
+      ints.Add(new IntWrapper(1));
+      Assert.AreEqual(ints[0], ints[1]);
+      Assert.AreNotSame(ints[0], ints[1]);
+      XmlGenerator.Serialize(ints, tempFile);
+      List<IntWrapper> newInts = (List<IntWrapper>)XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(newInts[0].Value, 1);
+      Assert.AreEqual(newInts[1].Value, 1);
+      Assert.AreEqual(newInts[0], newInts[1]);
+      Assert.AreNotSame(newInts[0], newInts[1]);
+    }
+
+    [TestMethod]
+    public void NonDefaultConstructorTest() {
+      NonDefaultConstructorClass c = new NonDefaultConstructorClass(1);
+      try {
+        XmlGenerator.Serialize(c, tempFile);
+        Assert.Fail("Exception not thrown");
+      } catch (PersistenceException) {
+      }
+    }
+
+    [TestMethod]
+    public void TestSavingException() {
+      List<int> list = new List<int> { 1, 2, 3 };
+      XmlGenerator.Serialize(list, tempFile);
+      NonSerializable s = new NonSerializable();
+      try {
+        XmlGenerator.Serialize(s, tempFile);
+        Assert.Fail("Exception expected");
+      } catch (PersistenceException) { }
+      List<int> newList = (List<int>)XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(list[0], newList[0]);
+      Assert.AreEqual(list[1], newList[1]);
+    }
+
+    [TestMethod]
+    public void TestTypeStringConversion() {
+      string name = typeof(List<int>[]).AssemblyQualifiedName;
+      string shortName =
+        "System.Collections.Generic.List`1[[System.Int32, mscorlib]][], mscorlib";
+      Assert.AreEqual(name, TypeNameParser.Parse(name).ToString());
+      Assert.AreEqual(shortName, TypeNameParser.Parse(name).ToString(false));
+      Assert.AreEqual(shortName, typeof(List<int>[]).VersionInvariantName());
+    }
+
+    [TestMethod]
+    public void TestHexadecimalPublicKeyToken() {
+      string name = "TestClass, TestAssembly, Version=1.2.3.4, PublicKey=1234abc";
+      string shortName = "TestClass, TestAssembly";
+      Assert.AreEqual(name, TypeNameParser.Parse(name).ToString());
+      Assert.AreEqual(shortName, TypeNameParser.Parse(name).ToString(false));
+    }
+
+    [TestMethod]
+    public void TestMultipleFailure() {
+      List<NonSerializable> l = new List<NonSerializable>();
+      l.Add(new NonSerializable());
+      l.Add(new NonSerializable());
+      l.Add(new NonSerializable());
+      try {
+        Serializer s = new Serializer(l,
+          ConfigurationService.Instance.GetConfiguration(new XmlFormat()),
+          "ROOT", true);
+        StringBuilder tokens = new StringBuilder();
+        foreach (var token in s) {
+          tokens.Append(token.ToString());
+        }
+        Assert.Fail("Exception expected");
+      } catch (PersistenceException px) {
+        Assert.AreEqual(3, px.Data.Count);
+      }
+    }
+
+    [TestMethod]
+    public void TestAssemblyVersionCheck() {
+      IntWrapper i = new IntWrapper(1);
+      Serializer s = new Serializer(i, ConfigurationService.Instance.GetDefaultConfig(new XmlFormat()));
+      XmlGenerator g = new XmlGenerator();
+      StringBuilder dataString = new StringBuilder();
+      foreach (var token in s) {
+        dataString.Append(g.Format(token));
+      }
+      StringBuilder typeString = new StringBuilder();
+      foreach (var line in g.Format(s.TypeCache))
+        typeString.Append(line);
+      Deserializer d = new Deserializer(XmlParser.ParseTypeCache(new StringReader(typeString.ToString())));
+      XmlParser p = new XmlParser(new StringReader(dataString.ToString()));
+      IntWrapper newI = (IntWrapper)d.Deserialize(p);
+      Assert.AreEqual(i.Value, newI.Value);
+
+      string newTypeString = Regex.Replace(typeString.ToString(),
+        "Version=\\d+\\.\\d+\\.\\d+\\.\\d+",
+        "Version=0.0.9999.9999");
+      try {
+        d = new Deserializer(XmlParser.ParseTypeCache(new StringReader(newTypeString)));
+        Assert.Fail("Exception expected");
+      } catch (PersistenceException x) {
+        Assert.IsTrue(x.Message.Contains("incompatible"));
+      }
+      newTypeString = Regex.Replace(typeString.ToString(),
+        "Version=(\\d+\\.\\d+)\\.\\d+\\.\\d+",
+        "Version=$1.9999.9999");
+      try {
+        d = new Deserializer(XmlParser.ParseTypeCache(new StringReader(newTypeString)));
+        Assert.Fail("Exception expected");
+      } catch (PersistenceException x) {
+        Assert.IsTrue(x.Message.Contains("newer"));
+      }
+    }
+
+    [TestMethod]
+    public void InheritanceTest() {
+      New n = new New();
+      XmlGenerator.Serialize(n, tempFile);
+      New nn = (New)XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(n.Name, nn.Name);
+      Assert.AreEqual(((Override)n).Name, ((Override)nn).Name);
+    }
+
+    class Child {
+      [Storable]
+      public GrandParent grandParent;
+    }
+
+    class Parent {
+      [Storable]
+      public Child child;
+    }
+
+    class GrandParent {
+      [Storable]
+      public Parent parent;
+    }
+
+    [TestMethod]
+    public void InstantiateParentChainReference() {
+      GrandParent gp = new GrandParent();
+      gp.parent = new Parent();
+      gp.parent.child = new Child();
+      gp.parent.child.grandParent = gp;
+      Assert.AreSame(gp, gp.parent.child.grandParent);
+      XmlGenerator.Serialize(gp, tempFile);
+      GrandParent newGp = (GrandParent)XmlParser.Deserialize(tempFile);
+      Assert.AreSame(newGp, newGp.parent.child.grandParent);
+    }
+
+    struct TestStruct {
+      int value;
+      int PropertyValue { get; set; }
+      public TestStruct(int value)
+        : this() {
+        this.value = value;
+        PropertyValue = value;
+      }
+    }
+
+    [TestMethod]
+    public void StructTest() {
+      TestStruct s = new TestStruct(10);
+      XmlGenerator.Serialize(s, tempFile);
+      TestStruct newS = (TestStruct)XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(s, newS);
+    }
+
+    [TestMethod]
+    public void PointTest() {
+      Point p = new Point(12, 34);
+      XmlGenerator.Serialize(p, tempFile);
+      Point newP = (Point)XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(p, newP);
+    }
+
+    [TestMethod]
+    public void NullableValueTypes() {
+      double?[] d = new double?[] { null, 1, 2, 3 };
+      XmlGenerator.Serialize(d, tempFile);
+      double?[] newD = (double?[])XmlParser.Deserialize(tempFile);
+      Assert.AreEqual(d[0], newD[0]);
+      Assert.AreEqual(d[1], newD[1]);
+      Assert.AreEqual(d[2], newD[2]);
+      Assert.AreEqual(d[3], newD[3]);
+    }
+
+    [TestMethod]
+    public void BitmapTest() {
+      Icon icon = System.Drawing.SystemIcons.Hand;
+      Bitmap bitmap = icon.ToBitmap();
+      XmlGenerator.Serialize(bitmap, tempFile);
+      Bitmap newBitmap = (Bitmap)XmlParser.Deserialize(tempFile);
+
+      Assert.AreEqual(bitmap.Size, newBitmap.Size);
+      for(int i=0; i< bitmap.Size.Width; i++)
+        for(int j =0; j< bitmap.Size.Height; j++)
+          Assert.AreEqual(bitmap.GetPixel(i,j),newBitmap.GetPixel(i,j));
+    }
+
+    [ClassInitialize]
+    public static void Initialize(TestContext testContext) {
+      ConfigurationService.Instance.Reset();
+    }
+  }
+}
