Changeset 2873 for trunk/sources/HeuristicLab.Persistence/UnitTests
- Timestamp:
- 02/26/10 15:46:10 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence/UnitTests/UseCases.cs
r2859 r2873 581 581 } 582 582 583 class Child { 584 [Storable] 585 public GrandParent grandParent; 586 } 587 588 class Parent { 589 [Storable] 590 public Child child; 591 } 592 593 class GrandParent { 594 [Storable] 595 public Parent parent; 596 } 597 598 [TestMethod] 599 public void InstantiateParentChainReference() { 600 GrandParent gp = new GrandParent(); 601 gp.parent = new Parent(); 602 gp.parent.child = new Child(); 603 gp.parent.child.grandParent = gp; 604 Assert.AreSame(gp, gp.parent.child.grandParent); 605 XmlGenerator.Serialize(gp, tempFile); 606 GrandParent newGp = (GrandParent)XmlParser.Deserialize(tempFile); 607 Assert.AreSame(newGp, newGp.parent.child.grandParent); 608 } 609 583 610 [ClassInitialize] 584 611 public static void Initialize(TestContext testContext) {
Note: See TracChangeset
for help on using the changeset viewer.