Ejemplo n.º 1
0
        private void AssertHeadersFilterButtonVisibilityB183058()
        {
            PivotGridControl   pivotGrid = FindElement <PivotGridControl>(DemoBaseTesting.CurrentDemoModule);
            List <FieldHeader> headers   = FindAllElements <FieldHeader>(pivotGrid);

            foreach (FieldHeader header in headers)
            {
                PivotGridField field            = header.Field;
                bool           fieldFiltered    = GetIsFiltered(field);
                Visibility     filterVisibility = fieldFiltered || header.IsMouseOver ? Visibility.Visible : Visibility.Hidden;
                if (!field.GetInternalField().ShowFilterButton)
                {
                    filterVisibility = Visibility.Collapsed;
                }
                if (filterVisibility != Visibility.Collapsed)
                {
                    AssertLog.IsTrue(fieldFiltered == field.IsFiltered, "field.IsFiltered " +
                                     DemoBaseTesting.CurrentDemoModule.GetType().Name +
                                     " " + field.Name + " expected\real:" + fieldFiltered.ToString() + " \\ " + field.IsFiltered.ToString());
                }
                AssertLog.IsTrue(filterVisibility == header.IsFilterButtonVisible, "header.IsFiltered " +
                                 DemoBaseTesting.CurrentDemoModule.GetType().Name +
                                 " " + field.Name + " expected\real:" + filterVisibility.ToString() + " \\ " + header.IsFilterButtonVisible.ToString());
            }
        }
Ejemplo n.º 2
0
        void ComboBoxItemsEditableB181973()
        {
            FrameworkElement control = ((DemoModule)DemoBaseTesting.CurrentDemoModule).DemoModuleControl.OptionsContent;

            if (control == null)
            {
                return;
            }
            List <ComboBoxEdit> editors = FindAllElements <ComboBoxEdit>(control);

            for (int i = 0; i < editors.Count; i++)
            {
                AssertLog.IsFalse((bool)editors[i].IsTextEditable, "ComboBoxEdit items editable: " + DemoBaseTesting.CurrentDemoModule.GetType().Name + " " + editors[i].Name);
                AssertLog.IsFalse(editors[i].SelectedIndex < 0, "ComboBoxEdit item is not selected: " + DemoBaseTesting.CurrentDemoModule.GetType().Name + " " + editors[i].Name);
            }
        }
Ejemplo n.º 3
0
        void TextBlockTextTrimmingB185312()
        {
            FrameworkElement control = ((DemoModule)DemoBaseTesting.CurrentDemoModule).DemoModuleControl.OptionsContent;

            if (control == null)
            {
                return;
            }
            List <TextBlock> editors = FindAllElements <TextBlock>(control);

            foreach (TextBlock edit in editors)
            {
                bool trimmed = TextBlockService.CalcIsTextTrimmed(edit) && edit.DesiredSize.Width > (edit.ActualWidth + edit.Margin.Left + edit.Margin.Right);
                AssertLog.IsFalse(trimmed, "Text is trimmed: " + DemoBaseTesting.CurrentDemoModule.GetType().Name + " text=" + edit.Text + ", Name=" + edit.Name +
                                  ", actual " + edit.ActualWidth + "px, desired:" + edit.DesiredSize.Width + "px");
            }
        }
Ejemplo n.º 4
0
        void AssertTextEditsWidthB185051()
        {
            FrameworkElement control = ((DemoModule)DemoBaseTesting.CurrentDemoModule).DemoModuleControl.OptionsContent;

            if (control == null)
            {
                return;
            }
            List <TextEdit> editors = FindAllElements <TextEdit>(control);

            foreach (TextEdit edit in editors)
            {
                if (edit.EditMode == EditMode.InplaceInactive || edit.IsPrintingMode == true)
                {
                    continue;
                }
                AssertLog.IsFalse(edit.Width == Double.PositiveInfinity, "TextEdit unlimited width: " + DemoBaseTesting.CurrentDemoModule.GetType().Name + " text=" + edit.Text + ", Name=" + edit.Name + " desired " + edit.ActualWidth + "px");
            }
        }