コード例 #1
0
        public void CountCaseTest()
        {
            Field  testField = Model.MatrixFields[0];
            String listCount = DBWorker.GetCountFromSqlStatement(DBWorker.CreateCaseCountSqlStatement(Model.SelectedDimensions, testField));

            Assert.IsNotNull(listCount, "Empty list");
            Assert.AreEqual("34", listCount, "Correct list count");
        }
コード例 #2
0
        /// <summary>
        /// Reacts to a click on a field in the matrix
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <author>Jannik Arndt, Bernhard Bruns</author>
        private void FieldClick(object sender, RoutedEventArgs e)
        {
            Cursor = Cursors.Wait;

            if (sender.GetType() == typeof(Button))
            {
                Field field = (((Button)sender).Tag as Field);

                if (field != null)
                {
                    field.ContentCounterTextChanged  = "\nEvents: " + DBWorker.GetCountFromSqlStatement(DBWorker.CreateEventCountSqlStatement(MainWindow.MatrixSelection.SelectedDimensions, field)) + " (Unique: " + DBWorker.GetCountFromSqlStatement(DBWorker.CreateUniqueEventCountSqlStatement(MainWindow.MatrixSelection.SelectedDimensions, field)) + ")";
                    field.ContentCounterTextChanged += "\nCases: " + DBWorker.GetCountFromSqlStatement(DBWorker.CreateCaseCountSqlStatement(MainWindow.MatrixSelection.SelectedDimensions, field));
                }
            }

            Cursor = Cursors.Arrow;
        }