Changeset 3935 for trunk/sources/HeuristicLab.Persistence/3.3/Tests
- Timestamp:
- 06/21/10 15:58:31 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs
r3811 r3935 42 42 namespace HeuristicLab.Persistence_33.Tests { 43 43 44 [StorableClass] 44 [StorableClass] 45 45 public class NumberTest { 46 46 [Storable] … … 288 288 Root newR = (Root)XmlParser.Deserialize(tempFile); 289 289 CompareComplexStorables(r, newR); 290 } 291 292 [TestMethod] 293 public void ComplexEasyStorable() { 294 Root r = InitializeComplexStorable(); 295 ReadableXmlGenerator.Serialize(r, tempFile); 296 using (var reader = new StreamReader(tempFile)) { 297 string text = reader.ReadToEnd(); 298 Assert.IsTrue(text.StartsWith("<Root")); 299 } 290 300 } 291 301 … … 774 784 775 785 Assert.AreEqual(bitmap.Size, newBitmap.Size); 776 for (int i=0; i< bitmap.Size.Width; i++)777 for (int j =0; j< bitmap.Size.Height; j++)778 Assert.AreEqual(bitmap.GetPixel(i, j),newBitmap.GetPixel(i,j));786 for (int i = 0; i < bitmap.Size.Width; i++) 787 for (int j = 0; j < bitmap.Size.Height; j++) 788 Assert.AreEqual(bitmap.GetPixel(i, j), newBitmap.GetPixel(i, j)); 779 789 } 780 790 … … 813 823 Assert.IsFalse(newHookTest.WasSerialized); 814 824 } 815 825 816 826 [StorableClass] 817 827 private class CustomConstructor { … … 858 868 859 869 [TestMethod] 860 public void TestRejectionJustifications() { 870 public void TestRejectionJustifications() { 861 871 NonSerializable ns = new NonSerializable(); 862 872 try { … … 864 874 Assert.Fail("PersistenceException expected"); 865 875 } catch (PersistenceException x) { 866 Assert.IsTrue(x.Message.Contains(new StorableSerializer().JustifyRejection(typeof(NonSerializable)))); 876 Assert.IsTrue(x.Message.Contains(new StorableSerializer().JustifyRejection(typeof(NonSerializable)))); 867 877 } 868 878 } … … 967 977 Assert.AreEqual(afs.Value3, newAfs.Value3); 968 978 Assert.AreEqual(afs.Value4, newAfs.Value4); 969 979 970 980 } 971 981 … … 996 1006 Assert.AreEqual(afs.Value2, newAfs.Value2); 997 1007 Assert.AreEqual(afs.Value3, newAfs.Value3); 998 Assert.AreEqual(afs.Value4, newAfs.Value4); 1008 Assert.AreEqual(afs.Value4, newAfs.Value4); 999 1009 } 1000 1010 … … 1022 1032 XmlGenerator.Serialize(afs, tempFile); 1023 1033 MarkedOnlyStorable newAfs = (MarkedOnlyStorable)XmlParser.Deserialize(tempFile); 1024 Assert.AreEqual(1, newAfs.Value1); 1034 Assert.AreEqual(1, newAfs.Value1); 1025 1035 Assert.AreEqual(afs.Value2, newAfs.Value2); 1026 1036 Assert.AreEqual(0, newAfs.Value3); … … 1054 1064 Assert.IsTrue(double.IsNaN(newSpecials[2])); 1055 1065 } 1056 1066 1057 1067 1058 1068 [ClassInitialize]
Note: See TracChangeset
for help on using the changeset viewer.