Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/XamlStyler.UnitTests/FileHandlingIntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,20 @@ public void TestIgnoringNamespacesInAttributeOrderingWithoutNamespace()
FileHandlingIntegrationTests.DoTest(stylerOptions);
}

[TestCase(false)]
[TestCase(true)]
public void TestTreatCommentWithTagAsMultiline(bool treatCommentWithTagAsMultiline)
{
var stylerOptions = new StylerOptions(
config: FileHandlingIntegrationTests.GetConfiguration(@"TestConfigurations/LegacyTestSettings.json"))
{
IndentSize = 2,
TreatCommentWithTagAsMultiline = treatCommentWithTagAsMultiline,
};

this.DoTestCase(stylerOptions, treatCommentWithTagAsMultiline);
}

private static void DoTest(
StylerOptions stylerOptions,
[System.Runtime.CompilerServices.CallerMemberName] string callerMemberName = "")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<Root>
<!--
<copyright>
etc etc
</copyright>
-->
<!--<copyright>
etc etc
</copyright>-->
<!-- regular comment -->
<!--
multiline comment
without tags
-->
<Window x:Class="Test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:system="clr-namespace:System;assembly=mscorlib"
Title="{Binding Title}"
Height="350" Width="525" Padding="3,2 ">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Text" Value="Default Text &amp;&lt;" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="false">
<!--
<Setter Property="Margin" Value=" 2" />
-->
<!--<Setter Property="Padding" Value=" 2,4 " />-->
<!--<Setter Property="Padding"
Value=" 2,4 " />-->
<!--<Setter
Property="Padding"
Value=" 2,4 " />-->
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<DockPanel Grid.Row="0" Grid.RowSpan="1" Grid.Column="0" Grid.ColumnSpan="1" Width="Auto" Height="Auto" Margin="0,0,0,0"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<StackPanel>
<!--<TextBox Margin="4"></TextBox>-->
<TextBox Margin="1 2 3 4"></TextBox>
<!--<Image
Width="20" Height="20" Margin="4,0,12,0" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality"
Source="{Binding FullPath, Converter={StaticResource FileIconConverter}, Mode=OneWay}" />-->
</StackPanel>
</DockPanel>
</Window>
</Root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<Root>
<!--
<copyright>
etc etc
</copyright>
-->
<!--<copyright>
etc etc
</copyright>-->
<!-- regular comment -->
<!--
multiline comment
without tags
-->
<Window x:Class="Test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
Title="{Binding Title}"
Width="525"
Height="350"
Padding="3,2 ">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Text" Value="Default Text &amp;&lt;" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="false">
<!--
<Setter Property="Margin" Value=" 2" />
-->
<!--<Setter Property="Padding" Value=" 2,4 " />-->
<!--<Setter Property="Padding"
Value=" 2,4 " />-->
<!--<Setter
Property="Padding"
Value=" 2,4 " />-->
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<DockPanel Grid.Row="0"
Grid.RowSpan="1"
Grid.Column="0"
Grid.ColumnSpan="1"
Width="Auto"
Height="Auto"
Margin="0,0,0,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<StackPanel>
<!--<TextBox Margin="4"></TextBox>-->
<TextBox Margin="1 2 3 4" />
<!--<Image
Width="20" Height="20" Margin="4,0,12,0" VerticalAlignment="Center" RenderOptions.BitmapScalingMode="HighQuality"
Source="{Binding FullPath, Converter={StaticResource FileIconConverter}, Mode=OneWay}" />-->
</StackPanel>
</DockPanel>
</Window>
</Root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<Root>
<!--
<copyright>
etc etc
</copyright>
-->
<!--
<copyright>
etc etc
</copyright>
-->
<!-- regular comment -->
<!--
multiline comment
without tags
-->
<Window x:Class="Test.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
Title="{Binding Title}"
Width="525"
Height="350"
Padding="3,2 ">
<Window.Resources>
<Style TargetType="TextBox">
<Setter Property="Text" Value="Default Text &amp;&lt;" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="false">
<!--
<Setter Property="Margin" Value=" 2" />
-->
<!--
<Setter Property="Padding" Value=" 2,4 " />
-->
<!--
<Setter Property="Padding"
Value=" 2,4 " />
-->
<!--
<Setter Property="Padding"
Value=" 2,4 " />
-->
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<DockPanel Grid.Row="0"
Grid.RowSpan="1"
Grid.Column="0"
Grid.ColumnSpan="1"
Width="Auto"
Height="Auto"
Margin="0,0,0,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<StackPanel>
<!--
<TextBox Margin="4"></TextBox>
-->
<TextBox Margin="1 2 3 4" />
<!--
<Image Width="20"
Height="20"
Margin="4,0,12,0"
VerticalAlignment="Center"
RenderOptions.BitmapScalingMode="HighQuality"
Source="{Binding FullPath, Converter={StaticResource FileIconConverter}, Mode=OneWay}" />
-->
</StackPanel>
</DockPanel>
</Window>
</Root>
9 changes: 9 additions & 0 deletions src/XamlStyler.UnitTests/XamlStyler.UnitTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,15 @@
<None Update="TestFiles\TestThicknessHandling_Space.expected">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="TestFiles\TestTreatCommentWithTagAsMultiline.testxaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="TestFiles\TestTreatCommentWithTagAsMultiline_false.expected">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="TestFiles\TestTreatCommentWithTagAsMultiline_true.expected">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="TestFiles\TestValueXmlEntityHandling.expected">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Loading