Inheritance: IStylerOptions
Example #1
0
        public void TestAttributeSortingOptionHandling()
        {
            string testInput = MethodBase.GetCurrentMethod().Name + ".xaml";

            var stylerOptions = new StylerOptions
                                    {
                                        AttributeOrderClass = "x:Class",
                                        AttributeOrderWpfNamespace = "xmlns, xmlns:x",
                                        AttributeOrderKey = "Key, x:Key",
                                        AttributeOrderName = "Name, x:Name, Title",
                                        AttributeOrderAttachedLayout =
                                            "Grid.Column, Grid.ColumnSpan, Grid.Row, Grid.RowSpan, Canvas.Right, Canvas.Bottom, Canvas.Left, Canvas.Top",
                                        AttributeOrderCoreLayout =
                                            "MinWidth, MinHeight, Width, Height, MaxWidth, MaxHeight, Margin",
                                        AttributeOrderAlignmentLayout =
                                            "Panel.ZIndex, HorizontalAlignment, VerticalAlignment, HorizontalContentAlignment, VerticalContentAlignment",
                                        AttributeOrderOthers =
                                            "Offset, Color, TargetName, Property, Value, StartPoint, EndPoint, PageSource, PageIndex",
                                        AttributeOrderBlendRelated =
                                            "mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText"
                                    };
            var styler = StylerService.CreateInstance(stylerOptions);

            DoTest(testInput, styler);
        }
Example #2
0
        public void TestxBindSplitting()
        {
            var stylerOptions = new StylerOptions
            {
                KeepxBindOnSameLine = true
            };

            DoTest(stylerOptions);
        }
Example #3
0
        public void TestAttributeToleranceHandling()
        {
            var stylerOptions = new StylerOptions
            {
                AttributesTolerance = 3,
                RootElementLineBreakRule = LineBreakRule.Always,
            };

            DoTest(stylerOptions);
        }
Example #4
0
        public void TestAttributeOrderRuleGroupsOnSeparateLinesHandling()
        {
            var stylerOptions = new StylerOptions
            {
                PutAttributeOrderRuleGroupsOnSeparateLines = true,
                MaxAttributesPerLine = 3,
            };

            DoTest(stylerOptions);
        }
Example #5
0
        public void TestMarkupExtensionHandling()
        {
            string testInput = MethodBase.GetCurrentMethod().Name + ".xaml";

            var stylerOptions = new StylerOptions
                                    {
                                        FormatMarkupExtension = true
                                    };
            var styler = StylerService.CreateInstance(stylerOptions);

            DoTest(testInput, styler);
        }
Example #6
0
        public void TestAttributeThresholdHandling()
        {
            var stylerOptions = new StylerOptions
            {
                AttributesTolerance = 0,
                MaxAttributeCharatersPerLine = 80,
                MaxAttributesPerLine = 3,
                PutEndingBracketOnNewLine = true
            };

            DoTest(stylerOptions);
        }
Example #7
0
        public void TestAttributeThresholdHandling()
        {
            string testInput = MethodBase.GetCurrentMethod().Name + ".xaml";

            var stylerOptions = new StylerOptions
                                    {
                                        AttributesTolerance = 0,
                                        MaxAttributeCharatersPerLine = 80,
                                        MaxAttributesPerLine = 3,
                                        PutEndingBracketOnNewLine = true
                                    };

            var styler = StylerService.CreateInstance(stylerOptions);

            DoTest(testInput, styler);
        }
Example #8
0
 private void DoTest(StylerOptions stylerOptions, [System.Runtime.CompilerServices.CallerMemberName] string callerMemberName = "")
 {
     // ReSharper disable once ExplicitCallerInfoArgument
     DoTest(StylerService.CreateInstance(stylerOptions), callerMemberName);
 }
Example #9
0
        public void TestReorderSetterByTargetNameThenPropertyHandling()
        {
            var stylerOptions = new StylerOptions
            {
                ReorderSetters = ReorderSettersBy.TargetNameThenProperty,
            };

            DoTest(stylerOptions);
        }
Example #10
0
        public void TestMarkupExtensionHandling()
        {
            var stylerOptions = new StylerOptions
            {
                FormatMarkupExtension = true
            };

            DoTest(stylerOptions);
        }
Example #11
0
        public void TestBindingSplitting()
        {
            var stylerOptions = new StylerOptions
            {
                KeepBindingsOnSameLine = true
            };

            DoTest(stylerOptions);
        }
Example #12
0
        public void TestClosingElementHandling(int testNumber, bool spaceBeforeClosingSlash)
        {
            var stylerOptions = new StylerOptions
            {
                SpaceBeforeClosingSlash = spaceBeforeClosingSlash
            };

            DoTest(stylerOptions, testNumber);
        }
Example #13
0
        public void TestReorderSetterHandling(int testNumber, ReorderSettersBy reorderSettersBy)
        {
            var stylerOptions = new StylerOptions
            {
                ReorderSetters = reorderSettersBy,
            };

            DoTest(stylerOptions, testNumber);
        }
Example #14
0
        public void TestMarkupWithAttributeNotOnFirstLine()
        {
            var stylerOptions = new StylerOptions
            {
                KeepFirstAttributeOnSameLine = false,
                AttributesTolerance = 1
            };

            DoTest(stylerOptions);
        }