示例#1
0
        public static void Run()
        {
            if (!ranTests)
            {
                // we depend on the graphics functions so make sure their tests succeed
                MatterHackers.Agg.Image.UnitTests.Run();

                MouseInteractionTests mouseInteractionTests = new MouseInteractionTests();
                mouseInteractionTests.ValidateSimpleLeftClick();
                mouseInteractionTests.ValidateOnlyTopWidgetGetsLeftClick();
                mouseInteractionTests.ValidateSimpleMouseUpDown();
                mouseInteractionTests.ValidateOnlyTopWidgetGetsMouseUp();
                mouseInteractionTests.ValidateEnterAndLeaveEvents();
                mouseInteractionTests.ValidateEnterAndLeaveEventsWhenNested();
                mouseInteractionTests.ValidateEnterAndLeaveEventsWhenCoverd();
                mouseInteractionTests.ValidateEnterAndLeaveInOverlapArea();
                mouseInteractionTests.MouseCapturedSpressesLeaveEvents();
                mouseInteractionTests.MouseCapturedSpressesLeaveEventsInButtonsSameAsRectangles();
                
                // these tests don't pass yet (they tests pass but scroll bars when grabed are brocken)
                //mouseInteractionTests.ValidateEnterLeaveOnWidgetMoves();
                //mouseInteractionTests.ValidateEnterLeaveOnWidgetBoundsChange();
                // these tests need to be writen
                //mouseInteractionTests.ValidateEnterLeaveOnWidgetAddAndRemoveChild();

                BackBufferTests backBufferTests = new BackBufferTests();
                //backBufferTests.saveImagesForDebug = true;
                backBufferTests.DoubleBufferTests();
                backBufferTests.BackBuffersAreScreenAligned();

                TextAndTextWidgetTests textTests = new TextAndTextWidgetTests();
                //textTests.saveImagesForDebug = true;
                textTests.TextWidgetVisibleTest();

                TextEditTests textEditTests = new TextEditTests();
                //TextEditTests.saveImagesForDebug = true;
                textEditTests.TextEditGetsFocusTests();
                textEditTests.TextEditTextSelectionTests();
                textEditTests.TextChangedEventsTests();
                textEditTests.NumEditHandlesNonNumberChars();
                textEditTests.TextEditingSpecialKeysWork();
                textEditTests.AddThenDeleteCausesNoVisualChange();
                textEditTests.MiltiLineTests();
                textEditTests.ScrollingToEndShowsEnd();

                AnchorTests anchorTests = new AnchorTests();
                //AnchorTests.saveImagesForDebug = true;
                anchorTests.SimpleFitToChildren();
                anchorTests.BottomAndTopSetAnchorBeforAddChild();
                anchorTests.BottomAndTop();
                anchorTests.CenterBothTests();
                anchorTests.CenterBothOffsetBoundsTests();
                anchorTests.AnchorLeftBottomTests();
                anchorTests.AnchorRightBottomTests();
                anchorTests.AnchorRightTopTests();
                anchorTests.AnchorAllTests();
                anchorTests.HCenterHRightAndVCenterVTopTests();
                anchorTests.GroupBoxResizeThenLayoutBeforeMatchChildren();

                FlowLayoutTests flowLayoutTests = new FlowLayoutTests();
                //FlowLayoutTests.saveImagesForDebug = true;
                flowLayoutTests.LeftToRightTests();
                flowLayoutTests.RightToLeftTests();
                flowLayoutTests.LeftToRightAnchorLeftBottomTests();
                flowLayoutTests.NestedLayoutTopToBottomTests();
                flowLayoutTests.NestedLayoutTopToBottomWithResizeTests();
                flowLayoutTests.AnchorLeftRightTests();
                flowLayoutTests.NestedFlowWidgetsTopToBottomTests();
                flowLayoutTests.NestedFlowWidgetsRightToLeftTests();
                flowLayoutTests.NestedFlowWidgetsLeftToRightTests();
                flowLayoutTests.LeftRightWithAnchorLeftRightChildTests();
                flowLayoutTests.RightLeftWithAnchorLeftRightChildTests();
                flowLayoutTests.BottomTopWithAnchorBottomTopChildTests();
                flowLayoutTests.TopBottomWithAnchorBottomTopChildTests();
                flowLayoutTests.EnsureFlowLayoutMinSizeFitsChildrenMinSize();
                flowLayoutTests.ChildVisibilityChangeCauseResize();
                flowLayoutTests.EnsureCorrectMinimumSize();
                flowLayoutTests.EnsureNestedAreMinimumSize();
                flowLayoutTests.EnsureCorrectSizeOnChildrenVisibleChange();
                flowLayoutTests.ChildHAnchorPriority();
                flowLayoutTests.TestVAnchorCenter();

                ScrollableWidgetTests scrollableWidgetTests = new ScrollableWidgetTests();
                //ScrollableWidgetTests.saveImagesForDebug = true;
                scrollableWidgetTests.LimitScrolToContetsTests();

                ListBoxTests listBoxTests = new ListBoxTests();
                //ListBoxTests.saveImagesForDebug = true;
                listBoxTests.SingleItemVisibleTest();
                listBoxTests.ScrollPositionStartsCorrect();

                MenuTests menuTests = new MenuTests();
                //MenuTests.saveImagesForDebug = true;
                menuTests.ListMenuTests();
                menuTests.DropDownListTests();

                ranTests = true;
            }
        }
示例#2
0
        public static void Run()
        {
            if (!ranTests)
            {
                // we depend on the graphics functions so make sure their tests succeed
                MatterHackers.Agg.Image.UnitTests.Run();

                MouseInteractionTests mouseInteractionTests = new MouseInteractionTests();
                mouseInteractionTests.ValidateSimpleLeftClick();
                mouseInteractionTests.ValidateOnlyTopWidgetGetsLeftClick();
                mouseInteractionTests.ValidateSimpleMouseUpDown();
                mouseInteractionTests.ValidateOnlyTopWidgetGetsMouseUp();
                mouseInteractionTests.ValidateEnterAndLeaveEvents();
                mouseInteractionTests.ValidateEnterAndLeaveEventsWhenNested();
                mouseInteractionTests.ValidateEnterAndLeaveEventsWhenCoverd();
                mouseInteractionTests.ValidateEnterAndLeaveInOverlapArea();
                mouseInteractionTests.MouseCapturedSpressesLeaveEvents();
                mouseInteractionTests.MouseCapturedSpressesLeaveEventsInButtonsSameAsRectangles();

                // these tests don't pass yet (they tests pass but scroll bars when grabed are brocken)
                //mouseInteractionTests.ValidateEnterLeaveOnWidgetMoves();
                //mouseInteractionTests.ValidateEnterLeaveOnWidgetBoundsChange();
                // these tests need to be writen
                //mouseInteractionTests.ValidateEnterLeaveOnWidgetAddAndRemoveChild();

                BackBufferTests backBufferTests = new BackBufferTests();
                //backBufferTests.saveImagesForDebug = true;
                backBufferTests.DoubleBufferTests();
                backBufferTests.BackBuffersAreScreenAligned();

                TextAndTextWidgetTests textTests = new TextAndTextWidgetTests();
                //textTests.saveImagesForDebug = true;
                textTests.TextWidgetVisibleTest();

                TextEditTests textEditTests = new TextEditTests();
                //TextEditTests.saveImagesForDebug = true;
                textEditTests.TextEditGetsFocusTests();
                textEditTests.TextEditTextSelectionTests();
                textEditTests.TextChangedEventsTests();
                textEditTests.NumEditHandlesNonNumberChars();
                textEditTests.TextEditingSpecialKeysWork();
                textEditTests.AddThenDeleteCausesNoVisualChange();
                textEditTests.MiltiLineTests();
                textEditTests.ScrollingToEndShowsEnd();

                AnchorTests anchorTests = new AnchorTests();
                //AnchorTests.saveImagesForDebug = true;
                anchorTests.SimpleFitToChildren();
                anchorTests.BottomAndTopSetAnchorBeforAddChild();
                anchorTests.BottomAndTop();
                anchorTests.CenterBothTests();
                anchorTests.CenterBothOffsetBoundsTests();
                anchorTests.AnchorLeftBottomTests();
                anchorTests.AnchorRightBottomTests();
                anchorTests.AnchorRightTopTests();
                anchorTests.AnchorAllTests();
                anchorTests.HCenterHRightAndVCenterVTopTests();
                anchorTests.GroupBoxResizeThenLayoutBeforeMatchChildren();

                FlowLayoutTests flowLayoutTests = new FlowLayoutTests();
                //FlowLayoutTests.saveImagesForDebug = true;
                flowLayoutTests.LeftToRightTests();
                flowLayoutTests.RightToLeftTests();
                flowLayoutTests.LeftToRightAnchorLeftBottomTests();
                flowLayoutTests.NestedLayoutTopToBottomTests();
                flowLayoutTests.NestedLayoutTopToBottomWithResizeTests();
                flowLayoutTests.AnchorLeftRightTests();
                flowLayoutTests.NestedFlowWidgetsTopToBottomTests();
                flowLayoutTests.NestedFlowWidgetsRightToLeftTests();
                flowLayoutTests.NestedFlowWidgetsLeftToRightTests();
                flowLayoutTests.LeftRightWithAnchorLeftRightChildTests();
                flowLayoutTests.RightLeftWithAnchorLeftRightChildTests();
                flowLayoutTests.BottomTopWithAnchorBottomTopChildTests();
                flowLayoutTests.TopBottomWithAnchorBottomTopChildTests();
                flowLayoutTests.EnsureFlowLayoutMinSizeFitsChildrenMinSize();
                flowLayoutTests.ChildVisibilityChangeCauseResize();
                flowLayoutTests.EnsureCorrectMinimumSize();
                flowLayoutTests.EnsureNestedAreMinimumSize();
                flowLayoutTests.EnsureCorrectSizeOnChildrenVisibleChange();
                flowLayoutTests.ChildHAnchorPriority();
                flowLayoutTests.TestVAnchorCenter();

                ScrollableWidgetTests scrollableWidgetTests = new ScrollableWidgetTests();
                //ScrollableWidgetTests.saveImagesForDebug = true;
                scrollableWidgetTests.LimitScrolToContetsTests();

                ListBoxTests listBoxTests = new ListBoxTests();
                //ListBoxTests.saveImagesForDebug = true;
                listBoxTests.SingleItemVisibleTest();
                listBoxTests.ScrollPositionStartsCorrect();

                MenuTests menuTests = new MenuTests();
                //MenuTests.saveImagesForDebug = true;
                menuTests.ListMenuTests();
                menuTests.DropDownListTests();

                ranTests = true;
            }
        }