public void TestLevelUp() { var parent = new Org(Guid.NewGuid()) { Name = "parentName" }; var child1 = new Org(Guid.NewGuid()) { Name = "child1" }; parent.Add(child1); Assert.IsFalse(parent.LevelUp()); Assert.IsTrue(child1.LevelUp()); Assert.IsNull(child1.Parent); Assert.IsNull(child1.OrderId); Assert.IsFalse(parent.Contains(child1)); }
public void TestLevelUp() { var parent = new Org(Guid.NewGuid()) {Name = "parentName"}; var child1 = new Org(Guid.NewGuid()) {Name = "child1"}; parent.Add(child1); Assert.IsFalse(parent.LevelUp()); Assert.IsTrue(child1.LevelUp()); Assert.IsNull(child1.Parent); Assert.IsNull(child1.OrderId); Assert.IsFalse(parent.Contains(child1)); }