Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/25/09 16:45:09 (15 years ago)
Author:
epitzer
Message:

Collect all exceptions during serialization and continue as far as possible. Throw a collected exception in th end. (#678)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/UnitTests/UseCases.cs

    r1938 r2106  
    506506
    507507    [TestMethod]
     508    public void TestMultipleFailure() {
     509      List<NonSerializable> l = new List<NonSerializable>();
     510      l.Add(new NonSerializable());
     511      l.Add(new NonSerializable());
     512      l.Add(new NonSerializable());
     513      try {
     514        Serializer s = new Serializer(l,
     515          ConfigurationService.Instance.GetConfiguration(new XmlFormat()),
     516          "ROOT", true);
     517        StringBuilder tokens = new StringBuilder();
     518        foreach (var token in s) {
     519          tokens.Append(token.ToString());
     520        }
     521        Assert.Fail("Exception expected");
     522      } catch (PersistenceException px) {
     523        Assert.AreEqual(3, px.Data.Count);
     524      }
     525    }
     526
     527    [TestMethod]
    508528    public void TestAssemblyVersionCheck() {
    509529      IntWrapper i = new IntWrapper(1);
Note: See TracChangeset for help on using the changeset viewer.