public void Contains() { DialogTree tree = m_project.ProjectDialogs.CreateNewDialogTree(); DialogTreeBranch branch = tree.CreateNewBranch(); DialogSegment one = branch.CreateNewDialog(12); DialogSegment two = branch.CreateNewDialog(13); Assert.IsTrue(branch.ContainsDialogSegment(one)); Assert.IsTrue(branch.ContainsDialogSegment(one.Id)); Assert.IsTrue(branch.ContainsDialogSegment(two)); Assert.IsTrue(branch.ContainsDialogSegment(two.Id)); }
public void Contains2() { DialogTree tree = m_project.ProjectDialogs.CreateNewDialogTree(); DialogTreeBranch branch = tree.CreateNewBranch(); DialogSegment one = branch.CreateNewDialog(12); Assert.IsTrue(branch.ContainsDialogSegment(one)); Assert.IsTrue(branch.ContainsDialogSegment(one.Id)); Assert.IsTrue(branch.RemoveDialog(one)); Assert.IsFalse(branch.ContainsDialogSegment(one)); Assert.IsFalse(branch.ContainsDialogSegment(one.Id)); }
public void Contains3() { DialogTree tree = m_project.ProjectDialogs.CreateNewDialogTree(); DialogTreeBranch branch = tree.CreateNewBranch(); DialogSegment one = branch.CreateNewDialog(12); Assert.IsTrue(branch.ContainsDialogSegment(one)); Assert.IsTrue(branch.ContainsDialogSegment(one.Id)); //make an id that has a different initial identifier but an id of an existing segment DialogTree tree2 = m_project.ProjectDialogs.CreateNewDialogTree(); DialogTreeBranch branch2 = tree2.CreateNewBranch(); DialogSegmentIdentifier fakeId = new DialogSegmentIdentifier(branch2.Id, one.Id.DialogSegmentId); Assert.IsFalse(branch.ContainsDialogSegment(fakeId)); }