Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/01/11 12:40:12 (13 years ago)
Author:
epitzer
Message:

Support exporting types in type cache and add a support method for XmlGenerator to access this list (#1403)

File:
1 edited

Legend:

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

    r5324 r5403  
    12281228    }
    12291229
     1230    [TestMethod]
     1231    public void TestTypeCacheExport() {
     1232      var test = new List<List<int>>();
     1233      test.Add(new List<int>() { 1, 2, 3 });
     1234      IEnumerable<Type> types;
     1235      using (var stream = new MemoryStream()) {
     1236        XmlGenerator.Serialize(test, stream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, out types);
     1237      }
     1238      List<Type> t = new List<Type>(types);
     1239      // Assert.IsTrue(t.Contains(typeof(int))); not serialized as an int list is directly transformed into a string
     1240      Assert.IsTrue(t.Contains(typeof(List<int>)));
     1241      Assert.IsTrue(t.Contains(typeof(List<List<int>>)));
     1242      Assert.AreEqual(t.Count, 2);
     1243    }
     1244
    12301245
    12311246
Note: See TracChangeset for help on using the changeset viewer.