Changeset 3946 for trunk/sources/HeuristicLab.Persistence/3.3/Tests
- Timestamp:
- 06/24/10 15:35:56 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs ΒΆ
r3937 r3946 1075 1075 } 1076 1076 1077 [TestMethod] 1078 public void TestCompactNumberArraySerializer() { 1079 Random r = new Random(); 1080 double[] a = new double[CompactNumberArray2StringSerializer.SPLIT_THRESHOLD * 2 + 1]; 1081 for (int i = 0; i < a.Length; i++) 1082 a[i] = r.Next(10); 1083 var config = ConfigurationService.Instance.GetDefaultConfig(new XmlFormat()); 1084 config = new Configuration(config.Format, 1085 config.PrimitiveSerializers.Where(s => s.SourceType != typeof(double[])), 1086 config.CompositeSerializers); 1087 XmlGenerator.Serialize(a, tempFile, config); 1088 double[] newA = XmlParser.Deserialize<double[]>(tempFile); 1089 Assert.AreEqual(a.Length, newA.Length); 1090 for (int i = 0; i < a.Rank; i++) { 1091 Assert.AreEqual(a.GetLength(i), newA.GetLength(i)); 1092 Assert.AreEqual(a.GetLowerBound(i), newA.GetLowerBound(i)); 1093 } 1094 for (int i = 0; i < a.Length; i++) { 1095 Assert.AreEqual(a[i], newA[i]); 1096 } 1097 } 1077 1098 1078 1099 [ClassInitialize]
Note: See TracChangeset
for help on using the changeset viewer.