Exemplo n.º 1
0
        public void SelectTextLine()
        {
            bool success = controller.LoadInitialFile(TestUtil.GetTestFile("selectionmgr\\desctext.ppen"), true);

            Assert.IsTrue(success);

            selectionMgr.SelectCourseView(Designator(6));

            selectionMgr.SelectTextLine(ControlId(18), CourseControlId(208), DescriptionLine.TextLineKind.BeforeCourseControl);
            SelectionMgr.SelectionInfo selectionInfo = selectionMgr.Selection;
            Assert.AreEqual(SelectionMgr.SelectionKind.TextLine, selectionInfo.SelectionKind);
            Assert.AreEqual(18, selectionInfo.SelectedControl.id);
            Assert.AreEqual(208, selectionInfo.SelectedCourseControl.id);
            Assert.AreEqual(DescriptionLine.TextLineKind.BeforeCourseControl, selectionInfo.SelectedTextLineKind);

            selectionMgr.SelectTextLine(ControlId(18), CourseControlId(208), DescriptionLine.TextLineKind.AfterCourseControl);
            selectionInfo = selectionMgr.Selection;
            Assert.AreEqual(SelectionMgr.SelectionKind.TextLine, selectionInfo.SelectionKind);
            Assert.AreEqual(18, selectionInfo.SelectedControl.id);
            Assert.AreEqual(208, selectionInfo.SelectedCourseControl.id);
            Assert.AreEqual(DescriptionLine.TextLineKind.AfterCourseControl, selectionInfo.SelectedTextLineKind);

            selectionMgr.SelectTextLine(ControlId(18), CourseControlId(208), DescriptionLine.TextLineKind.BeforeControl);
            selectionInfo = selectionMgr.Selection;
            Assert.AreEqual(SelectionMgr.SelectionKind.TextLine, selectionInfo.SelectionKind);
            Assert.AreEqual(18, selectionInfo.SelectedControl.id);
            Assert.AreEqual(208, selectionInfo.SelectedCourseControl.id);
            Assert.AreEqual(DescriptionLine.TextLineKind.BeforeControl, selectionInfo.SelectedTextLineKind);

            selectionMgr.SelectTextLine(ControlId(18), CourseControlId(208), DescriptionLine.TextLineKind.AfterControl);
            selectionInfo = selectionMgr.Selection;
            Assert.AreEqual(SelectionMgr.SelectionKind.TextLine, selectionInfo.SelectionKind);
            Assert.AreEqual(18, selectionInfo.SelectedControl.id);
            Assert.AreEqual(208, selectionInfo.SelectedCourseControl.id);
            Assert.AreEqual(DescriptionLine.TextLineKind.AfterControl, selectionInfo.SelectedTextLineKind);
        }