Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/14/09 13:00:36 (16 years ago)
Author:
epitzer
Message:

Also make sure major and minor version match (not only newer) + better tests. (#613)

File:
1 edited

Legend:

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

    r1780 r1795  
    550550      IntWrapper newI = (IntWrapper)d.Deserialize(p);
    551551      Assert.AreEqual(i.Value, newI.Value);
     552
    552553      string newTypeString = Regex.Replace(typeString.ToString(),
    553         "Version=(\\d+\\.\\d+\\.\\d+\\.\\d+)",
    554         "Version=9999.9999.9999.9999");
     554        "Version=\\d+\\.\\d+\\.\\d+\\.\\d+",
     555        "Version=0.0.9999.9999");
    555556      try {
    556557        d = new Deserializer(XmlParser.ParseTypeCache(new StringReader(newTypeString)));
    557558        Assert.Fail("Exception expected");
    558       } catch (PersistenceException) {
    559         // EXPECTED
     559      } catch (PersistenceException x) {
     560        Assert.IsTrue(x.Message.Contains("incompatible"));
     561      }
     562      newTypeString = Regex.Replace(typeString.ToString(),
     563        "Version=(\\d+\\.\\d+)\\.\\d+\\.\\d+",
     564        "Version=$1.9999.9999");
     565      try {
     566        d = new Deserializer(XmlParser.ParseTypeCache(new StringReader(newTypeString)));
     567        Assert.Fail("Exception expected");
     568      } catch (PersistenceException x) {
     569        Assert.IsTrue(x.Message.Contains("newer"));
    560570      }
    561571    }
Note: See TracChangeset for help on using the changeset viewer.