GetColumnChoices() private méthode

Figure out what columns should be available, given a selected row.
private GetColumnChoices ( IConstChartRow row ) : ICmPossibility[]
row IConstChartRow
Résultat ICmPossibility[]
Exemple #1
0
        public void GetColumnChoices_SameRowCol0()
        {
            // Setup test here; modify as needed
            var       rowClicked   = m_helper.MakeRow(null);
            const int icolClicked  = 0;
            var       eligibleRows = new List <IConstChartRow> {
                rowClicked
            };

            //var cellPart = m_helper.MakeMissingMarker(rowClicked, icolClicked);

            SetClickedCell(rowClicked, icolClicked);
            SetEligibleRows(eligibleRows);
            SetupParamObjBase();
            //SetupParameterObject(cellPart);

            // SUT
            var result1 = m_dlgLogicPrepose.GetColumnChoices(rowClicked);
            var result2 = m_dlgLogicPostpose.GetColumnChoices(rowClicked);

            // Verify changes
            var cnewArray = m_eligCols.Length - 1;
            var expected  = new ICmPossibility[cnewArray];

            for (var i = 0; i < cnewArray; i++)
            {
                expected[i] = m_eligCols[i + 1];
            }
            Assert.AreEqual(expected, result1, "Prepose within same row should give all following columns.");
            Assert.AreEqual(new ICmPossibility[0], result2, "Postpose within same row should give empty list of columns.");
        }
Exemple #2
0
        public void GetColumnChoices_SameRowCol0()
        {
            // Setup test here; modify as needed
            CmIndirectAnnotation rowClicked = m_helper.MakeRow(null);
            int icolClicked = 0;
            List <ICmIndirectAnnotation> eligibleRows = new List <ICmIndirectAnnotation>();

            eligibleRows.Add(rowClicked);

            CmIndirectAnnotation dataCca = m_helper.MakeIndirectAnnotation();

            SetClickedCell(rowClicked, icolClicked);
            SetEligibleRows(eligibleRows);
            SetupParameterObject(dataCca.Hvo);

            int[] result1;
            int[] result2;

            // SUT
            result1 = m_dlgLogicPrepose.GetColumnChoices(rowClicked);             // The row clicked is the same row that the
            result2 = m_dlgLogicPostpose.GetColumnChoices(rowClicked);            // user chose from the dialog combobox.

            // Verify changes
            int cnewArray = m_eligCols.Length - 1;

            int[] expected = new int[cnewArray];
            for (int i = 0; i < cnewArray; i++)
            {
                expected[i] = m_eligCols[i + 1];
            }
            Assert.AreEqual(expected, result1, "Prepose within same row should give all following columns.");
            Assert.AreEqual(new int[0], result2, "Postpose within same row should give empty list of columns.");
        }