public void UTSignalFragmentRemoveChildren2() { ISignalContainer testItem1 = (new SignalFragment( new List <ISignalContent> { new Wave(1, 0), new Wave(1, 2), new SignalFragment(0, new List <ISignalContent> { new Wave(1, 1) }), new SignalFragment(3, new List <ISignalContent> { new Wave(1, 8), }), } ) as ISignalContainer); Assert.AreEqual(testItem1.GetChildren(recursive: false).Count, 4); testItem1.RemoveChildren(); Assert.AreEqual(testItem1.GetChildren(recursive: false).Count, 0); }
public void UTSignalFragmentRemoveChildren1() { List <ISignalContent> testItemList = new List <ISignalContent> { new Wave(1, 0), new Wave(1, 2) }; ISignalContainer testItem1 = (new SignalFragment( new List <ISignalContent> { testItemList[0], new SignalFragment(0, new List <ISignalContent> { new Wave(1, 1) }), new SignalFragment(3, new List <ISignalContent> { new Wave(1, 8), }), testItemList[1], } ) as ISignalContainer); Assert.AreEqual(testItem1.GetChildren(recursive: false).Count, 4); testItem1.RemoveChildren(testItemList); Assert.AreEqual(testItem1.GetChildren(recursive: false).Count, 2); }