Changeset 15020 for branches/PersistenceReintegration/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs
- Timestamp:
- 06/01/17 15:15:25 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceReintegration/HeuristicLab.Tests/HeuristicLab.Persistence-3.3/UseCasesPersistenceNew.cs
r15018 r15020 268 268 } 269 269 270 [StorableType("6494ee1d-877b-4e78-83df-f3f55a77b9b4")]271 270 public class NonSerializable { 272 271 int x = 0; … … 1382 1381 int value; 1383 1382 int PropertyValue { get; set; } 1383 1384 /* 1385 [StorableConstructor] 1386 public TestStruct(StorableConstructorFlag deserializing) { 1387 value = 0; 1388 PropertyValue = 0; 1389 } 1390 */ 1391 1384 1392 public TestStruct(int value) 1385 1393 : this() { … … 1584 1592 public int Value4 { get; private set; } 1585 1593 [StorableConstructor] 1586 public AllFieldsStorable(bool isDeserializing) { 1587 if (!isDeserializing) { 1588 Value1 = 12; 1589 Value2 = 23; 1590 Value3 = 34; 1591 Value4 = 56; 1592 } 1594 public AllFieldsStorable(StorableConstructorFlag isdeserializing) { 1595 } 1596 1597 public void InitValues() { 1598 Value1 = 12; 1599 Value2 = 23; 1600 Value3 = 34; 1601 Value4 = 56; 1593 1602 } 1594 1603 } … … 1599 1608 public void TestStorableTypeDiscoveryAllFields() { 1600 1609 ProtoBufSerializer serializer = new ProtoBufSerializer(); 1601 AllFieldsStorable afs = new AllFieldsStorable(false); 1610 AllFieldsStorable afs = new AllFieldsStorable(default(StorableConstructorFlag)); 1611 afs.InitValues(); 1602 1612 serializer.Serialize(afs, tempFile); 1603 1613 AllFieldsStorable newAfs = (AllFieldsStorable)serializer.Deserialize(tempFile); … … 1615 1625 public int Value3 { get; private set; } 1616 1626 public int Value4 { get; private set; } 1617 [StorableConstructor] 1618 public AllPropertiesStorable(bool isDeserializing) { 1619 if (!isDeserializing) { 1620 Value1 = 12; 1621 Value2 = 23; 1622 Value3 = 34; 1623 Value4 = 56; 1624 } 1627 1628 public AllPropertiesStorable() { 1629 } 1630 1631 public void InitValues() { 1632 Value1 = 12; 1633 Value2 = 23; 1634 Value3 = 34; 1635 Value4 = 56; 1625 1636 } 1626 1637 } … … 1631 1642 public void TestStorableTypeDiscoveryAllProperties() { 1632 1643 ProtoBufSerializer serializer = new ProtoBufSerializer(); 1633 AllPropertiesStorable afs = new AllPropertiesStorable(false); 1644 AllPropertiesStorable afs = new AllPropertiesStorable(); 1645 afs.InitValues(); 1634 1646 serializer.Serialize(afs, tempFile); 1635 1647 AllPropertiesStorable newAfs = (AllPropertiesStorable)serializer.Deserialize(tempFile); … … 1648 1660 public int Value3 { get; private set; } 1649 1661 public int Value4 { get; private set; } 1650 [StorableConstructor] 1651 public AllFieldsAndAllPropertiesStorable(bool isDeserializing) { 1652 if (!isDeserializing) { 1653 Value1 = 12; 1654 Value2 = 23; 1655 Value3 = 34; 1656 Value4 = 56; 1657 } 1662 1663 public AllFieldsAndAllPropertiesStorable() { 1664 } 1665 1666 public void InitValues() { 1667 Value1 = 12; 1668 Value2 = 23; 1669 Value3 = 34; 1670 Value4 = 56; 1671 1658 1672 } 1659 1673 } … … 1664 1678 public void TestStorableTypeDiscoveryAllFieldsAndAllProperties() { 1665 1679 ProtoBufSerializer serializer = new ProtoBufSerializer(); 1666 AllFieldsAndAllPropertiesStorable afs = new AllFieldsAndAllPropertiesStorable(false); 1680 AllFieldsAndAllPropertiesStorable afs = new AllFieldsAndAllPropertiesStorable(); 1681 afs.InitValues(); 1667 1682 serializer.Serialize(afs, tempFile); 1668 1683 AllFieldsAndAllPropertiesStorable newAfs = (AllFieldsAndAllPropertiesStorable)serializer.Deserialize(tempFile); … … 1680 1695 public int Value3 { get; private set; } 1681 1696 public int Value4 { get; private set; } 1682 [StorableConstructor]1683 public MarkedOnlyStorable(bool isDeserializing) {1684 if (!isDeserializing) { 1685 Value1 = 12;1686 Value2 = 23;1687 Value3 = 34;1688 Value4 = 56;1689 }1697 public MarkedOnlyStorable() { 1698 } 1699 1700 public void InitValues() { 1701 Value1 = 12; 1702 Value2 = 23; 1703 Value3 = 34; 1704 Value4 = 56; 1690 1705 } 1691 1706 } … … 1696 1711 public void TestStorableTypeDiscoveryMarkedOnly() { 1697 1712 ProtoBufSerializer serializer = new ProtoBufSerializer(); 1698 MarkedOnlyStorable afs = new MarkedOnlyStorable(false); 1713 MarkedOnlyStorable afs = new MarkedOnlyStorable(); 1714 afs.InitValues(); 1699 1715 serializer.Serialize(afs, tempFile); 1700 1716 MarkedOnlyStorable newAfs = (MarkedOnlyStorable)serializer.Deserialize(tempFile);
Note: See TracChangeset
for help on using the changeset viewer.