Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5698 for trunk


Ignore:
Timestamp:
03/15/11 18:06:00 (12 years ago)
Author:
epitzer
Message:

Add a simple TupleSerializer for .NET 4.0 Tuple types. (#1442)

Location:
trunk/sources/HeuristicLab.Persistence/3.3
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj

    r5290 r5698  
    142142    <Compile Include="Default\CompositeSerializers\CompactNumberArray2StringSerializer.cs" />
    143143    <Compile Include="Default\CompositeSerializers\ConcreteDictionarySerializer.cs" />
     144    <Compile Include="Default\CompositeSerializers\TupleSerializer.cs" />
    144145    <Compile Include="Default\CompositeSerializers\HashSetSerializer.cs" />
    145146    <Compile Include="Default\CompositeSerializers\DictionarySerializer.cs" />
  • trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs

    r5445 r5698  
    12431243    }
    12441244
     1245    [TestMethod]
     1246    public void TupleTest() {
     1247      var t1 = Tuple.Create(1);
     1248      var t2 = Tuple.Create('1', "2");
     1249      var t3 = Tuple.Create(3.0, 3f, 5);
     1250      var t4 = Tuple.Create(Tuple.Create(1, 2, 3), Tuple.Create(4, 5, 6), Tuple.Create(8, 9, 10));
     1251      var tuple = Tuple.Create(t1, t2, t3, t4);
     1252      XmlGenerator.Serialize(tuple, tempFile);
     1253      var newTuple = XmlParser.Deserialize<Tuple<Tuple<int>, Tuple<char, string>, Tuple<double, float, int>, Tuple<Tuple<int, int, int>, Tuple<int, int, int>, Tuple<int, int, int>>>>(tempFile);
     1254      Assert.AreEqual(tuple, newTuple);
     1255    }
     1256
    12451257
    12461258
Note: See TracChangeset for help on using the changeset viewer.