Index: trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs
===================================================================
--- trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs	(revision 1823)
+++ trunk/sources/HeuristicLab.Persistence/3.3/Core/Serializer.cs	(revision 2106)
@@ -34,4 +34,6 @@
     private readonly Dictionary<Type, int> typeCache;
     private readonly Configuration configuration;
+    private readonly bool isTestRun;
+    private readonly List<Exception> exceptions;
 
     public List<TypeMapping> TypeCache {
@@ -78,5 +80,9 @@
       this(obj, configuration, "ROOT") { }
 
-    public Serializer(object obj, Configuration configuration, string rootName) {
+    public Serializer(object obj, Configuration configuration, string rootName)
+      : this(obj, configuration, rootName, false) { }
+
+    public Serializer(object obj, Configuration configuration, string rootName, bool isTestRun) {
+    
       this.obj = obj;
       this.rootName = rootName;
@@ -84,4 +90,6 @@
       obj2id = new Dictionary<object, int>(new ReferenceEqualityComparer()) { { new object(), 0 } };
       typeCache = new Dictionary<Type, int>();
+      this.isTestRun = isTestRun;
+      this.exceptions = new List<Exception>();
     }
 
@@ -91,5 +99,19 @@
 
     public IEnumerator<ISerializationToken> GetEnumerator() {
-      return Serialize(new DataMemberAccessor(rootName, null, () => obj, null));
+      var enumerator = Serialize(new DataMemberAccessor(rootName, null, () => obj, null));
+      if (isTestRun) {
+        return AddExceptionCompiler(enumerator);
+      } else {
+        return enumerator;
+      }
+    }
+
+    public IEnumerator<ISerializationToken> AddExceptionCompiler(IEnumerator<ISerializationToken> enumerator) {
+      while (enumerator.MoveNext())
+        yield return enumerator.Current;
+      if (exceptions.Count == 1)
+        throw exceptions[0];
+      if (exceptions.Count > 1)
+        throw new PersistenceException("Multiple exceptions during serialization", exceptions);
     }
 
@@ -109,20 +131,28 @@
         obj2id.Add(value, (int)id);
       }
-      IPrimitiveSerializer primitiveSerializer = configuration.GetPrimitiveSerializer(type);
-      if (primitiveSerializer != null)
-        return PrimitiveEnumerator(accessor.Name, typeId, primitiveSerializer.Format(value), id);
-      ICompositeSerializer compositeSerializer = configuration.GetCompositeSerializer(type);
-      if (compositeSerializer != null)
-        return CompositeEnumerator(accessor.Name, compositeSerializer.Decompose(value), id, typeId, compositeSerializer.CreateMetaInfo(value));
-      throw new PersistenceException(
-          String.Format(
-          "No suitable method for serializing values of type \"{0}\" found\r\n" +
-          "primitive serializers:\r\n{1}\r\n" +
-          "composite serializers:\r\n{2}",
-          value.GetType().VersionInvariantName(),
-          string.Join("\r\n", configuration.PrimitiveSerializers.Select(f => f.GetType().VersionInvariantName()).ToArray()),
-          string.Join("\r\n", configuration.CompositeSerializers.Select(d => d.GetType().VersionInvariantName()).ToArray())
-          ));
-
+      try {
+        IPrimitiveSerializer primitiveSerializer = configuration.GetPrimitiveSerializer(type);
+        if (primitiveSerializer != null)
+          return PrimitiveEnumerator(accessor.Name, typeId, primitiveSerializer.Format(value), id);
+        ICompositeSerializer compositeSerializer = configuration.GetCompositeSerializer(type);
+        if (compositeSerializer != null)
+          return CompositeEnumerator(accessor.Name, compositeSerializer.Decompose(value), id, typeId, compositeSerializer.CreateMetaInfo(value));
+        throw new PersistenceException(
+            String.Format(
+            "No suitable method for serializing values of type \"{0}\" found\r\n" +
+            "primitive serializers:\r\n{1}\r\n" +
+            "composite serializers:\r\n{2}",
+            value.GetType().VersionInvariantName(),
+            string.Join("\r\n", configuration.PrimitiveSerializers.Select(f => f.GetType().VersionInvariantName()).ToArray()),
+            string.Join("\r\n", configuration.CompositeSerializers.Select(d => d.GetType().VersionInvariantName()).ToArray())
+            ));
+      } catch (Exception x) {
+        if (isTestRun) {
+          exceptions.Add(x);
+          return new List<ISerializationToken>().GetEnumerator();
+        } else {
+          throw x;
+        }
+      }
     }
 
