|
|
@ -1,4 +1,4 @@ |
|
|
|
//
|
|
|
|
//
|
|
|
|
// TestFormattingVisitor.cs
|
|
|
|
// TestFormattingVisitor.cs
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Author:
|
|
|
|
// Author:
|
|
|
@ -37,7 +37,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestFieldSpacesBeforeComma1() |
|
|
|
public void TestFieldSpacesBeforeComma1() |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions(); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.ClassBraceStyle = BraceStyle.EndOfLine; |
|
|
|
policy.ClassBraceStyle = BraceStyle.EndOfLine; |
|
|
|
policy.SpaceBeforeFieldDeclarationComma = false; |
|
|
|
policy.SpaceBeforeFieldDeclarationComma = false; |
|
|
|
policy.SpaceAfterFieldDeclarationComma = false; |
|
|
|
policy.SpaceAfterFieldDeclarationComma = false; |
|
|
@ -53,7 +53,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestFieldSpacesBeforeComma2 () |
|
|
|
public void TestFieldSpacesBeforeComma2 () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.ClassBraceStyle = BraceStyle.EndOfLine; |
|
|
|
policy.ClassBraceStyle = BraceStyle.EndOfLine; |
|
|
|
policy.SpaceBeforeFieldDeclarationComma = true; |
|
|
|
policy.SpaceBeforeFieldDeclarationComma = true; |
|
|
|
policy.SpaceAfterFieldDeclarationComma = true; |
|
|
|
policy.SpaceAfterFieldDeclarationComma = true; |
|
|
@ -69,7 +69,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestFixedFieldSpacesBeforeComma () |
|
|
|
public void TestFixedFieldSpacesBeforeComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.ClassBraceStyle = BraceStyle.EndOfLine; |
|
|
|
policy.ClassBraceStyle = BraceStyle.EndOfLine; |
|
|
|
policy.SpaceAfterFieldDeclarationComma = true; |
|
|
|
policy.SpaceAfterFieldDeclarationComma = true; |
|
|
|
policy.SpaceBeforeFieldDeclarationComma = true; |
|
|
|
policy.SpaceBeforeFieldDeclarationComma = true; |
|
|
@ -85,7 +85,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestConstFieldSpacesBeforeComma () |
|
|
|
public void TestConstFieldSpacesBeforeComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.ClassBraceStyle = BraceStyle.EndOfLine; |
|
|
|
policy.ClassBraceStyle = BraceStyle.EndOfLine; |
|
|
|
policy.SpaceAfterFieldDeclarationComma = false; |
|
|
|
policy.SpaceAfterFieldDeclarationComma = false; |
|
|
|
policy.SpaceBeforeFieldDeclarationComma = false; |
|
|
|
policy.SpaceBeforeFieldDeclarationComma = false; |
|
|
@ -101,7 +101,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeMethodDeclarationParentheses () |
|
|
|
public void TestBeforeMethodDeclarationParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeMethodDeclarationParentheses = true; |
|
|
|
policy.SpaceBeforeMethodDeclarationParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
Test (policy, @"public abstract class Test
|
|
|
|
Test (policy, @"public abstract class Test
|
|
|
@ -117,7 +117,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeConstructorDeclarationParenthesesDestructorCase () |
|
|
|
public void TestBeforeConstructorDeclarationParenthesesDestructorCase () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeConstructorDeclarationParentheses = true; |
|
|
|
policy.SpaceBeforeConstructorDeclarationParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
Test (policy, @"class Test
|
|
|
|
Test (policy, @"class Test
|
|
|
@ -148,7 +148,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesAroundMultiplicativeOperator () |
|
|
|
public void TestSpacesAroundMultiplicativeOperator () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAroundMultiplicativeOperator = true; |
|
|
|
policy.SpaceAroundMultiplicativeOperator = true; |
|
|
|
|
|
|
|
|
|
|
|
TestBinaryOperator (policy, "*"); |
|
|
|
TestBinaryOperator (policy, "*"); |
|
|
@ -158,7 +158,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesAroundShiftOperator () |
|
|
|
public void TestSpacesAroundShiftOperator () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAroundShiftOperator = true; |
|
|
|
policy.SpaceAroundShiftOperator = true; |
|
|
|
TestBinaryOperator (policy, "<<"); |
|
|
|
TestBinaryOperator (policy, "<<"); |
|
|
|
TestBinaryOperator (policy, ">>"); |
|
|
|
TestBinaryOperator (policy, ">>"); |
|
|
@ -167,7 +167,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesAroundAdditiveOperator () |
|
|
|
public void TestSpacesAroundAdditiveOperator () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAroundAdditiveOperator = true; |
|
|
|
policy.SpaceAroundAdditiveOperator = true; |
|
|
|
|
|
|
|
|
|
|
|
TestBinaryOperator (policy, "+"); |
|
|
|
TestBinaryOperator (policy, "+"); |
|
|
@ -177,7 +177,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesAroundBitwiseOperator () |
|
|
|
public void TestSpacesAroundBitwiseOperator () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAroundBitwiseOperator = true; |
|
|
|
policy.SpaceAroundBitwiseOperator = true; |
|
|
|
|
|
|
|
|
|
|
|
TestBinaryOperator (policy, "&"); |
|
|
|
TestBinaryOperator (policy, "&"); |
|
|
@ -188,7 +188,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesAroundRelationalOperator () |
|
|
|
public void TestSpacesAroundRelationalOperator () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAroundRelationalOperator = true; |
|
|
|
policy.SpaceAroundRelationalOperator = true; |
|
|
|
|
|
|
|
|
|
|
|
TestBinaryOperator (policy, "<"); |
|
|
|
TestBinaryOperator (policy, "<"); |
|
|
@ -200,7 +200,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesAroundEqualityOperator () |
|
|
|
public void TestSpacesAroundEqualityOperator () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAroundEqualityOperator = true; |
|
|
|
policy.SpaceAroundEqualityOperator = true; |
|
|
|
|
|
|
|
|
|
|
|
TestBinaryOperator (policy, "=="); |
|
|
|
TestBinaryOperator (policy, "=="); |
|
|
@ -210,7 +210,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesAroundLogicalOperator () |
|
|
|
public void TestSpacesAroundLogicalOperator () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAroundLogicalOperator = true; |
|
|
|
policy.SpaceAroundLogicalOperator = true; |
|
|
|
|
|
|
|
|
|
|
|
TestBinaryOperator (policy, "&&"); |
|
|
|
TestBinaryOperator (policy, "&&"); |
|
|
@ -220,7 +220,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestConditionalOperator () |
|
|
|
public void TestConditionalOperator () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeConditionalOperatorCondition = true; |
|
|
|
policy.SpaceBeforeConditionalOperatorCondition = true; |
|
|
|
policy.SpaceAfterConditionalOperatorCondition = true; |
|
|
|
policy.SpaceAfterConditionalOperatorCondition = true; |
|
|
|
policy.SpaceBeforeConditionalOperatorSeparator = true; |
|
|
|
policy.SpaceBeforeConditionalOperatorSeparator = true; |
|
|
@ -256,7 +256,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeMethodCallParenthesesSpace () |
|
|
|
public void TestBeforeMethodCallParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeMethodCallParentheses = true; |
|
|
|
policy.SpaceBeforeMethodCallParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -288,7 +288,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinMethodCallParenthesesSpace () |
|
|
|
public void TestWithinMethodCallParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceWithinMethodCallParentheses = true; |
|
|
|
policy.SpaceWithinMethodCallParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -318,7 +318,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeIfParenthesesSpace () |
|
|
|
public void TestBeforeIfParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeIfParentheses = true; |
|
|
|
policy.SpaceBeforeIfParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -335,7 +335,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinIfParenthesesSpace () |
|
|
|
public void TestWithinIfParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinIfParentheses = true; |
|
|
|
policy.SpacesWithinIfParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -352,7 +352,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeWhileParenthesesSpace () |
|
|
|
public void TestBeforeWhileParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeWhileParentheses = true; |
|
|
|
policy.SpaceBeforeWhileParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -369,7 +369,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinWhileParenthesesSpace () |
|
|
|
public void TestWithinWhileParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinWhileParentheses = true; |
|
|
|
policy.SpacesWithinWhileParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -387,7 +387,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeForParenthesesSpace () |
|
|
|
public void TestBeforeForParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeForParentheses = true; |
|
|
|
policy.SpaceBeforeForParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -404,7 +404,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinForParenthesesSpace () |
|
|
|
public void TestWithinForParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinForParentheses = true; |
|
|
|
policy.SpacesWithinForParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -421,7 +421,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeForeachParenthesesSpace () |
|
|
|
public void TestBeforeForeachParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeForeachParentheses = true; |
|
|
|
policy.SpaceBeforeForeachParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -438,7 +438,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinForeachParenthesesSpace () |
|
|
|
public void TestWithinForeachParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinForeachParentheses = true; |
|
|
|
policy.SpacesWithinForeachParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -455,7 +455,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeCatchParenthesesSpace () |
|
|
|
public void TestBeforeCatchParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeCatchParentheses = true; |
|
|
|
policy.SpaceBeforeCatchParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -472,7 +472,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinCatchParenthesesSpace () |
|
|
|
public void TestWithinCatchParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinCatchParentheses = true; |
|
|
|
policy.SpacesWithinCatchParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -489,7 +489,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeLockParenthesesSpace () |
|
|
|
public void TestBeforeLockParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeLockParentheses = true; |
|
|
|
policy.SpaceBeforeLockParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -506,7 +506,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinLockParenthesesSpace () |
|
|
|
public void TestWithinLockParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinLockParentheses = true; |
|
|
|
policy.SpacesWithinLockParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -523,7 +523,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesAfterForSemicolon () |
|
|
|
public void TestSpacesAfterForSemicolon () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAfterForSemicolon = true; |
|
|
|
policy.SpaceAfterForSemicolon = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -541,7 +541,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesBeforeForSemicolon () |
|
|
|
public void TestSpacesBeforeForSemicolon () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeForSemicolon = true; |
|
|
|
policy.SpaceBeforeForSemicolon = true; |
|
|
|
policy.SpaceAfterForSemicolon = false; |
|
|
|
policy.SpaceAfterForSemicolon = false; |
|
|
|
|
|
|
|
|
|
|
@ -560,7 +560,7 @@ namespace ICSharpCode.NRefactory.CSharp.FormattingTests |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesAfterTypecast () |
|
|
|
public void TestSpacesAfterTypecast () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAfterTypecast = true; |
|
|
|
policy.SpaceAfterTypecast = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -578,7 +578,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeUsingParenthesesSpace () |
|
|
|
public void TestBeforeUsingParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeUsingParentheses = true; |
|
|
|
policy.SpaceBeforeUsingParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -595,7 +595,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinUsingParenthesesSpace () |
|
|
|
public void TestWithinUsingParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinUsingParentheses = true; |
|
|
|
policy.SpacesWithinUsingParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -623,7 +623,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestAroundAssignmentSpace () |
|
|
|
public void TestAroundAssignmentSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAroundAssignment = true; |
|
|
|
policy.SpaceAroundAssignment = true; |
|
|
|
|
|
|
|
|
|
|
|
TestAssignmentOperator (policy, "="); |
|
|
|
TestAssignmentOperator (policy, "="); |
|
|
@ -642,7 +642,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestAroundAssignmentSpaceInDeclarations () |
|
|
|
public void TestAroundAssignmentSpaceInDeclarations () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAroundAssignment = true; |
|
|
|
policy.SpaceAroundAssignment = true; |
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
void TestMe () |
|
|
|
void TestMe () |
|
|
@ -659,7 +659,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeSwitchParenthesesSpace () |
|
|
|
public void TestBeforeSwitchParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeSwitchParentheses = true; |
|
|
|
policy.SpaceBeforeSwitchParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -676,7 +676,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinSwitchParenthesesSpace () |
|
|
|
public void TestWithinSwitchParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinSwitchParentheses = true; |
|
|
|
policy.SpacesWithinSwitchParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -693,7 +693,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinParenthesesSpace () |
|
|
|
public void TestWithinParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinParentheses = true; |
|
|
|
policy.SpacesWithinParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -710,7 +710,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinMethodDeclarationParenthesesSpace () |
|
|
|
public void TestWithinMethodDeclarationParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceWithinMethodDeclarationParentheses = true; |
|
|
|
policy.SpaceWithinMethodDeclarationParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -726,7 +726,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinCastParenthesesSpace () |
|
|
|
public void TestWithinCastParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinCastParentheses = true; |
|
|
|
policy.SpacesWithinCastParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -743,7 +743,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinSizeOfParenthesesSpace () |
|
|
|
public void TestWithinSizeOfParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinSizeOfParentheses = true; |
|
|
|
policy.SpacesWithinSizeOfParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -760,7 +760,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeSizeOfParentheses () |
|
|
|
public void TestBeforeSizeOfParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeSizeOfParentheses = true; |
|
|
|
policy.SpaceBeforeSizeOfParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -777,7 +777,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinTypeOfParenthesesSpace () |
|
|
|
public void TestWithinTypeOfParenthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinTypeOfParentheses = true; |
|
|
|
policy.SpacesWithinTypeOfParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -794,7 +794,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeTypeOfParentheses () |
|
|
|
public void TestBeforeTypeOfParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeTypeOfParentheses = true; |
|
|
|
policy.SpaceBeforeTypeOfParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -812,7 +812,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinCheckedExpressionParanthesesSpace () |
|
|
|
public void TestWithinCheckedExpressionParanthesesSpace () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinCheckedExpressionParantheses = true; |
|
|
|
policy.SpacesWithinCheckedExpressionParantheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -841,7 +841,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpaceBeforeNewParentheses () |
|
|
|
public void TestSpaceBeforeNewParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeNewParentheses = true; |
|
|
|
policy.SpaceBeforeNewParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -858,7 +858,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinNewParentheses () |
|
|
|
public void TestWithinNewParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinNewParentheses = true; |
|
|
|
policy.SpacesWithinNewParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -875,7 +875,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBetweenEmptyNewParentheses () |
|
|
|
public void TestBetweenEmptyNewParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesBetweenEmptyNewParentheses = true; |
|
|
|
policy.SpacesBetweenEmptyNewParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -892,7 +892,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeNewParameterComma () |
|
|
|
public void TestBeforeNewParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeNewParameterComma = true; |
|
|
|
policy.SpaceBeforeNewParameterComma = true; |
|
|
|
policy.SpaceAfterNewParameterComma = false; |
|
|
|
policy.SpaceAfterNewParameterComma = false; |
|
|
|
|
|
|
|
|
|
|
@ -910,7 +910,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestAfterNewParameterComma () |
|
|
|
public void TestAfterNewParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAfterNewParameterComma = true; |
|
|
|
policy.SpaceAfterNewParameterComma = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -927,7 +927,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestFieldDeclarationComma () |
|
|
|
public void TestFieldDeclarationComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeFieldDeclarationComma = false; |
|
|
|
policy.SpaceBeforeFieldDeclarationComma = false; |
|
|
|
policy.SpaceAfterFieldDeclarationComma = true; |
|
|
|
policy.SpaceAfterFieldDeclarationComma = true; |
|
|
|
|
|
|
|
|
|
|
@ -955,7 +955,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeMethodDeclarationParameterComma () |
|
|
|
public void TestBeforeMethodDeclarationParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeMethodDeclarationParameterComma = true; |
|
|
|
policy.SpaceBeforeMethodDeclarationParameterComma = true; |
|
|
|
policy.SpaceAfterMethodDeclarationParameterComma = false; |
|
|
|
policy.SpaceAfterMethodDeclarationParameterComma = false; |
|
|
|
|
|
|
|
|
|
|
@ -976,7 +976,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestAfterMethodDeclarationParameterComma () |
|
|
|
public void TestAfterMethodDeclarationParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeMethodDeclarationParameterComma = false; |
|
|
|
policy.SpaceBeforeMethodDeclarationParameterComma = false; |
|
|
|
policy.SpaceAfterMethodDeclarationParameterComma = true; |
|
|
|
policy.SpaceAfterMethodDeclarationParameterComma = true; |
|
|
|
|
|
|
|
|
|
|
@ -997,7 +997,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesInLambdaExpression () |
|
|
|
public void TestSpacesInLambdaExpression () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinWhileParentheses = true; |
|
|
|
policy.SpacesWithinWhileParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -1014,7 +1014,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeLocalVariableDeclarationComma () |
|
|
|
public void TestBeforeLocalVariableDeclarationComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeLocalVariableDeclarationComma = true; |
|
|
|
policy.SpaceBeforeLocalVariableDeclarationComma = true; |
|
|
|
policy.SpaceAfterLocalVariableDeclarationComma = false; |
|
|
|
policy.SpaceAfterLocalVariableDeclarationComma = false; |
|
|
|
|
|
|
|
|
|
|
@ -1041,7 +1041,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestLocalVariableDeclarationComma () |
|
|
|
public void TestLocalVariableDeclarationComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeLocalVariableDeclarationComma = true; |
|
|
|
policy.SpaceBeforeLocalVariableDeclarationComma = true; |
|
|
|
policy.SpaceAfterLocalVariableDeclarationComma = true; |
|
|
|
policy.SpaceAfterLocalVariableDeclarationComma = true; |
|
|
|
|
|
|
|
|
|
|
@ -1069,7 +1069,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestLocalVariableWithGenerics () |
|
|
|
public void TestLocalVariableWithGenerics () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeLocalVariableDeclarationComma = true; |
|
|
|
policy.SpaceBeforeLocalVariableDeclarationComma = true; |
|
|
|
policy.SpaceAfterLocalVariableDeclarationComma = true; |
|
|
|
policy.SpaceAfterLocalVariableDeclarationComma = true; |
|
|
|
|
|
|
|
|
|
|
@ -1090,7 +1090,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeConstructorDeclarationParentheses () |
|
|
|
public void TestBeforeConstructorDeclarationParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeConstructorDeclarationParentheses = true; |
|
|
|
policy.SpaceBeforeConstructorDeclarationParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test
|
|
|
|
var result = GetResult (policy, @"class Test
|
|
|
@ -1111,7 +1111,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeConstructorDeclarationParameterComma () |
|
|
|
public void TestBeforeConstructorDeclarationParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeConstructorDeclarationParameterComma = true; |
|
|
|
policy.SpaceBeforeConstructorDeclarationParameterComma = true; |
|
|
|
policy.SpaceAfterConstructorDeclarationParameterComma = false; |
|
|
|
policy.SpaceAfterConstructorDeclarationParameterComma = false; |
|
|
|
|
|
|
|
|
|
|
@ -1134,7 +1134,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestAfterConstructorDeclarationParameterComma () |
|
|
|
public void TestAfterConstructorDeclarationParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeConstructorDeclarationParameterComma = false; |
|
|
|
policy.SpaceBeforeConstructorDeclarationParameterComma = false; |
|
|
|
policy.SpaceAfterConstructorDeclarationParameterComma = true; |
|
|
|
policy.SpaceAfterConstructorDeclarationParameterComma = true; |
|
|
|
|
|
|
|
|
|
|
@ -1155,7 +1155,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinConstructorDeclarationParentheses () |
|
|
|
public void TestWithinConstructorDeclarationParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceWithinConstructorDeclarationParentheses = true; |
|
|
|
policy.SpaceWithinConstructorDeclarationParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -1171,7 +1171,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBetweenEmptyConstructorDeclarationParentheses () |
|
|
|
public void TestBetweenEmptyConstructorDeclarationParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBetweenEmptyConstructorDeclarationParentheses = true; |
|
|
|
policy.SpaceBetweenEmptyConstructorDeclarationParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -1190,7 +1190,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeDelegateDeclarationParentheses () |
|
|
|
public void TestBeforeDelegateDeclarationParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeDelegateDeclarationParentheses = true; |
|
|
|
policy.SpaceBeforeDelegateDeclarationParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"delegate void Test();"); |
|
|
|
var result = GetResult (policy, @"delegate void Test();"); |
|
|
@ -1201,7 +1201,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeDelegateDeclarationParenthesesComplex () |
|
|
|
public void TestBeforeDelegateDeclarationParenthesesComplex () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeDelegateDeclarationParentheses = true; |
|
|
|
policy.SpaceBeforeDelegateDeclarationParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, "delegate void TestDelegate\t\t\t();"); |
|
|
|
var result = GetResult (policy, "delegate void TestDelegate\t\t\t();"); |
|
|
@ -1212,7 +1212,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeDelegateDeclarationParameterComma () |
|
|
|
public void TestBeforeDelegateDeclarationParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeDelegateDeclarationParameterComma = true; |
|
|
|
policy.SpaceBeforeDelegateDeclarationParameterComma = true; |
|
|
|
policy.SpaceAfterDelegateDeclarationParameterComma = false; |
|
|
|
policy.SpaceAfterDelegateDeclarationParameterComma = false; |
|
|
|
|
|
|
|
|
|
|
@ -1232,7 +1232,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestAfterDelegateDeclarationParameterComma () |
|
|
|
public void TestAfterDelegateDeclarationParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeDelegateDeclarationParameterComma = false; |
|
|
|
policy.SpaceBeforeDelegateDeclarationParameterComma = false; |
|
|
|
policy.SpaceAfterDelegateDeclarationParameterComma = true; |
|
|
|
policy.SpaceAfterDelegateDeclarationParameterComma = true; |
|
|
|
|
|
|
|
|
|
|
@ -1252,7 +1252,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinDelegateDeclarationParentheses () |
|
|
|
public void TestWithinDelegateDeclarationParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceWithinDelegateDeclarationParentheses = true; |
|
|
|
policy.SpaceWithinDelegateDeclarationParentheses = true; |
|
|
|
var result = GetResult (policy, @"delegate void Test (int a);"); |
|
|
|
var result = GetResult (policy, @"delegate void Test (int a);"); |
|
|
|
|
|
|
|
|
|
|
@ -1264,7 +1264,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBetweenEmptyDelegateDeclarationParentheses () |
|
|
|
public void TestBetweenEmptyDelegateDeclarationParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBetweenEmptyDelegateDeclarationParentheses = true; |
|
|
|
policy.SpaceBetweenEmptyDelegateDeclarationParentheses = true; |
|
|
|
var result = GetResult (policy, @"delegate void Test();"); |
|
|
|
var result = GetResult (policy, @"delegate void Test();"); |
|
|
|
|
|
|
|
|
|
|
@ -1279,7 +1279,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeMethodCallParentheses () |
|
|
|
public void TestBeforeMethodCallParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeMethodCallParentheses = true; |
|
|
|
policy.SpaceBeforeMethodCallParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
@ -1302,7 +1302,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeMethodCallParameterComma () |
|
|
|
public void TestBeforeMethodCallParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeMethodCallParameterComma = true; |
|
|
|
policy.SpaceBeforeMethodCallParameterComma = true; |
|
|
|
policy.SpaceAfterMethodCallParameterComma = false; |
|
|
|
policy.SpaceAfterMethodCallParameterComma = false; |
|
|
|
|
|
|
|
|
|
|
@ -1327,7 +1327,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestAfterMethodCallParameterComma () |
|
|
|
public void TestAfterMethodCallParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeMethodCallParameterComma = false; |
|
|
|
policy.SpaceBeforeMethodCallParameterComma = false; |
|
|
|
policy.SpaceAfterMethodCallParameterComma = true; |
|
|
|
policy.SpaceAfterMethodCallParameterComma = true; |
|
|
|
|
|
|
|
|
|
|
@ -1352,7 +1352,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinMethodCallParentheses () |
|
|
|
public void TestWithinMethodCallParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceWithinMethodCallParentheses = true; |
|
|
|
policy.SpaceWithinMethodCallParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
@ -1370,7 +1370,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBetweenEmptyMethodCallParentheses () |
|
|
|
public void TestBetweenEmptyMethodCallParentheses () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBetweenEmptyMethodCallParentheses = true; |
|
|
|
policy.SpaceBetweenEmptyMethodCallParentheses = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
@ -1392,7 +1392,7 @@ return (Test)null; |
|
|
|
public void TestBeforeIndexerDeclarationBracket () |
|
|
|
public void TestBeforeIndexerDeclarationBracket () |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeIndexerDeclarationBracket = true; |
|
|
|
policy.SpaceBeforeIndexerDeclarationBracket = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
@ -1416,7 +1416,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeIndexerDeclarationParameterComma () |
|
|
|
public void TestBeforeIndexerDeclarationParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeIndexerDeclarationParameterComma = true; |
|
|
|
policy.SpaceBeforeIndexerDeclarationParameterComma = true; |
|
|
|
policy.SpaceAfterIndexerDeclarationParameterComma = false; |
|
|
|
policy.SpaceAfterIndexerDeclarationParameterComma = false; |
|
|
|
|
|
|
|
|
|
|
@ -1437,7 +1437,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestAfterIndexerDeclarationParameterComma () |
|
|
|
public void TestAfterIndexerDeclarationParameterComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAfterIndexerDeclarationParameterComma = true; |
|
|
|
policy.SpaceAfterIndexerDeclarationParameterComma = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
@ -1456,7 +1456,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestWithinIndexerDeclarationBracket () |
|
|
|
public void TestWithinIndexerDeclarationBracket () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceWithinIndexerDeclarationBracket = true; |
|
|
|
policy.SpaceWithinIndexerDeclarationBracket = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
|
var result = GetResult (policy, @"class FooBar
|
|
|
@ -1479,7 +1479,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesWithinBrackets () |
|
|
|
public void TestSpacesWithinBrackets () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesWithinBrackets = true; |
|
|
|
policy.SpacesWithinBrackets = true; |
|
|
|
policy.SpacesBeforeBrackets = false; |
|
|
|
policy.SpacesBeforeBrackets = false; |
|
|
|
|
|
|
|
|
|
|
@ -1503,7 +1503,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesBeforeBrackets () |
|
|
|
public void TestSpacesBeforeBrackets () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpacesBeforeBrackets = true; |
|
|
|
policy.SpacesBeforeBrackets = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test
|
|
|
|
var result = GetResult (policy, @"class Test
|
|
|
@ -1527,7 +1527,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestBeforeBracketComma () |
|
|
|
public void TestBeforeBracketComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeBracketComma = true; |
|
|
|
policy.SpaceBeforeBracketComma = true; |
|
|
|
policy.SpaceAfterBracketComma = false; |
|
|
|
policy.SpaceAfterBracketComma = false; |
|
|
|
|
|
|
|
|
|
|
@ -1546,7 +1546,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestAfterBracketComma () |
|
|
|
public void TestAfterBracketComma () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceAfterBracketComma = true; |
|
|
|
policy.SpaceAfterBracketComma = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -1566,7 +1566,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpacesBeforeArrayDeclarationBrackets () |
|
|
|
public void TestSpacesBeforeArrayDeclarationBrackets () |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions (); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceBeforeArrayDeclarationBrackets = true; |
|
|
|
policy.SpaceBeforeArrayDeclarationBrackets = true; |
|
|
|
|
|
|
|
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
|
var result = GetResult (policy, @"class Test {
|
|
|
@ -1586,7 +1586,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestRemoveWhitespacesBeforeSemicolon() |
|
|
|
public void TestRemoveWhitespacesBeforeSemicolon() |
|
|
|
{ |
|
|
|
{ |
|
|
|
CSharpFormattingOptions policy = new CSharpFormattingOptions(); |
|
|
|
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
var result = GetResult(policy, @"class Test {
|
|
|
|
var result = GetResult(policy, @"class Test {
|
|
|
|
void TestMe () |
|
|
|
void TestMe () |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1601,7 +1601,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpaceInNamedArgumentAfterDoubleColon() |
|
|
|
public void TestSpaceInNamedArgumentAfterDoubleColon() |
|
|
|
{ |
|
|
|
{ |
|
|
|
var policy = new CSharpFormattingOptions(); |
|
|
|
var policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceInNamedArgumentAfterDoubleColon = true; |
|
|
|
policy.SpaceInNamedArgumentAfterDoubleColon = true; |
|
|
|
var result = GetResult(policy, @"class Test {
|
|
|
|
var result = GetResult(policy, @"class Test {
|
|
|
|
void TestMe () |
|
|
|
void TestMe () |
|
|
@ -1617,7 +1617,7 @@ return (Test)null; |
|
|
|
[Test()] |
|
|
|
[Test()] |
|
|
|
public void TestSpaceInNamedArgumentAfterDoubleColon2() |
|
|
|
public void TestSpaceInNamedArgumentAfterDoubleColon2() |
|
|
|
{ |
|
|
|
{ |
|
|
|
var policy = new CSharpFormattingOptions(); |
|
|
|
var policy = FormattingOptionsFactory.CreateMono (); |
|
|
|
policy.SpaceInNamedArgumentAfterDoubleColon = false; |
|
|
|
policy.SpaceInNamedArgumentAfterDoubleColon = false; |
|
|
|
var result = GetResult(policy, @"class Test {
|
|
|
|
var result = GetResult(policy, @"class Test {
|
|
|
|
void TestMe () |
|
|
|
void TestMe () |
|
|
|