提交 c1338281 编写于 作者: C Cyrus Najmabadi

Remove ConfigureAwait(true) from test code.

上级 5e31d025
...@@ -24,13 +24,13 @@ public async Task EndOfLine() ...@@ -24,13 +24,13 @@ public async Task EndOfLine()
var content = @"namespace A{/*1*/}/*2*/"; var content = @"namespace A{/*1*/}/*2*/";
var expected = @"namespace A{}"; var expected = @"namespace A{}";
await AssertFormatAsync(content, expected).ConfigureAwait(true); await AssertFormatAsync(content, expected);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
public async Task Simple1() public async Task Simple1()
{ {
await AssertFormatAsync("namespace A/*1*/{}/*2*/ class A {}", "namespace A{ } class A {}").ConfigureAwait(true); await AssertFormatAsync("namespace A/*1*/{}/*2*/ class A {}", "namespace A{ } class A {}");
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -48,7 +48,7 @@ class A /*1*/{}/*2*/"; ...@@ -48,7 +48,7 @@ class A /*1*/{}/*2*/";
class A { }"; class A { }";
await AssertFormatAsync(content, expected).ConfigureAwait(true); await AssertFormatAsync(content, expected);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -66,7 +66,7 @@ class A /*1*/{}/*2*/"; ...@@ -66,7 +66,7 @@ class A /*1*/{}/*2*/";
class A { }"; class A { }";
await AssertFormatAsync(content, expected).ConfigureAwait(true); await AssertFormatAsync(content, expected);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -84,7 +84,7 @@ class A{}/*2*/"; ...@@ -84,7 +84,7 @@ class A{}/*2*/";
class A { }"; class A { }";
await AssertFormatAsync(content, expected).ConfigureAwait(true); await AssertFormatAsync(content, expected);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -102,7 +102,7 @@ class A{}/*2*/"; ...@@ -102,7 +102,7 @@ class A{}/*2*/";
class A { }"; class A { }";
await AssertFormatAsync(content, expected).ConfigureAwait(true); await AssertFormatAsync(content, expected);
} }
[Fact] [Fact]
...@@ -127,7 +127,7 @@ void F() ...@@ -127,7 +127,7 @@ void F()
}"; }";
var changingOptions = new Dictionary<OptionKey, object>(); var changingOptions = new Dictionary<OptionKey, object>();
changingOptions.Add(CSharpFormattingOptions.IndentBlock, false); changingOptions.Add(CSharpFormattingOptions.IndentBlock, false);
await AssertFormatAsync(code, expected, changedOptionSet: changingOptions).ConfigureAwait(true); await AssertFormatAsync(code, expected, changedOptionSet: changingOptions);
} }
[Fact] [Fact]
...@@ -152,7 +152,7 @@ void F() ...@@ -152,7 +152,7 @@ void F()
}"; }";
var changingOptions = new Dictionary<OptionKey, object>(); var changingOptions = new Dictionary<OptionKey, object>();
changingOptions.Add(CSharpFormattingOptions.WrappingPreserveSingleLine, false); changingOptions.Add(CSharpFormattingOptions.WrappingPreserveSingleLine, false);
await AssertFormatAsync(code, expected, changedOptionSet: changingOptions).ConfigureAwait(true); await AssertFormatAsync(code, expected, changedOptionSet: changingOptions);
} }
[WorkItem(539231, "DevDiv")] [WorkItem(539231, "DevDiv")]
......
...@@ -26,7 +26,7 @@ public async Task PreprocessorInEmptyFile() ...@@ -26,7 +26,7 @@ public async Task PreprocessorInEmptyFile()
#error #error
"; ";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -38,7 +38,7 @@ class C { }"; ...@@ -38,7 +38,7 @@ class C { }";
var expected = @"// single line comment var expected = @"// single line comment
class C { }"; class C { }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -56,7 +56,7 @@ public async Task Comment2() ...@@ -56,7 +56,7 @@ public async Task Comment2()
int i; int i;
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -72,7 +72,7 @@ public async Task Comment3() ...@@ -72,7 +72,7 @@ public async Task Comment3()
// single line comment // single line comment
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -92,7 +92,7 @@ public async Task Comment4() ...@@ -92,7 +92,7 @@ public async Task Comment4()
void Method() { } void Method() { }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -115,7 +115,7 @@ void Method() ...@@ -115,7 +115,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -140,7 +140,7 @@ void Method() ...@@ -140,7 +140,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -169,7 +169,7 @@ void Method() ...@@ -169,7 +169,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -194,7 +194,7 @@ void Method() ...@@ -194,7 +194,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -219,7 +219,7 @@ void Method() ...@@ -219,7 +219,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -246,7 +246,7 @@ void Method() ...@@ -246,7 +246,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -283,7 +283,7 @@ void Method() ...@@ -283,7 +283,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -320,7 +320,7 @@ void Method() ...@@ -320,7 +320,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -341,7 +341,7 @@ void Method() ...@@ -341,7 +341,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -366,7 +366,7 @@ void Method() ...@@ -366,7 +366,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -387,7 +387,7 @@ void Method() ...@@ -387,7 +387,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -412,7 +412,7 @@ void Method() ...@@ -412,7 +412,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -439,7 +439,7 @@ void Method() ...@@ -439,7 +439,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content, true).ConfigureAwait(true); await AssertFormatAsync(expected, content, true);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -468,7 +468,7 @@ void Method() ...@@ -468,7 +468,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -499,7 +499,7 @@ void Method() ...@@ -499,7 +499,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -530,7 +530,7 @@ void Method() ...@@ -530,7 +530,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
// for now, formatting engine doesn't re-indent token if the indentation line contains noisy // for now, formatting engine doesn't re-indent token if the indentation line contains noisy
...@@ -554,7 +554,7 @@ void Method() ...@@ -554,7 +554,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
// for now, formatting engine doesn't re-indent token if the indentation line contains noisy // for now, formatting engine doesn't re-indent token if the indentation line contains noisy
...@@ -579,7 +579,7 @@ void Method() ...@@ -579,7 +579,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -600,7 +600,7 @@ void Method() ...@@ -600,7 +600,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -624,7 +624,7 @@ void Method() ...@@ -624,7 +624,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -649,7 +649,7 @@ void Method() ...@@ -649,7 +649,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -672,7 +672,7 @@ void Method() ...@@ -672,7 +672,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -697,7 +697,7 @@ void Method() ...@@ -697,7 +697,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -720,7 +720,7 @@ void Method() ...@@ -720,7 +720,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -741,7 +741,7 @@ void Method() ...@@ -741,7 +741,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -764,7 +764,7 @@ void Method() ...@@ -764,7 +764,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -787,7 +787,7 @@ void Method() ...@@ -787,7 +787,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -812,7 +812,7 @@ void Method() ...@@ -812,7 +812,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -837,7 +837,7 @@ void Method() ...@@ -837,7 +837,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -866,7 +866,7 @@ void Method() ...@@ -866,7 +866,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -897,7 +897,7 @@ void Method() ...@@ -897,7 +897,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -924,7 +924,7 @@ void Method() ...@@ -924,7 +924,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -953,7 +953,7 @@ void Method() ...@@ -953,7 +953,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -990,7 +990,7 @@ void Method() ...@@ -990,7 +990,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1025,7 +1025,7 @@ void Method() ...@@ -1025,7 +1025,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1058,7 +1058,7 @@ void Method() ...@@ -1058,7 +1058,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1083,7 +1083,7 @@ void Method() ...@@ -1083,7 +1083,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1110,7 +1110,7 @@ void Method() ...@@ -1110,7 +1110,7 @@ void Method()
#endif #endif
"; ";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1141,7 +1141,7 @@ void Method() ...@@ -1141,7 +1141,7 @@ void Method()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1173,7 +1173,7 @@ void Method() ...@@ -1173,7 +1173,7 @@ void Method()
"; ";
// turn off transformation check - conditional directive preprocessor // turn off transformation check - conditional directive preprocessor
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1202,7 +1202,7 @@ void Method() ...@@ -1202,7 +1202,7 @@ void Method()
} }
"; ";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1231,7 +1231,7 @@ void Method() ...@@ -1231,7 +1231,7 @@ void Method()
} }
"; ";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1260,7 +1260,7 @@ void Method() ...@@ -1260,7 +1260,7 @@ void Method()
} }
"; ";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1291,7 +1291,7 @@ void Method() ...@@ -1291,7 +1291,7 @@ void Method()
} }
"; ";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1336,7 +1336,7 @@ public async Task MixAll() ...@@ -1336,7 +1336,7 @@ public async Task MixAll()
"; ";
// turn off transformation check since it doesn't work for conditional directive yet. // turn off transformation check since it doesn't work for conditional directive yet.
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[WorkItem(537895, "DevDiv")] [WorkItem(537895, "DevDiv")]
...@@ -1368,7 +1368,7 @@ void Method() ...@@ -1368,7 +1368,7 @@ void Method()
} }
"; ";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[WorkItem(537895, "DevDiv")] [WorkItem(537895, "DevDiv")]
...@@ -1398,7 +1398,7 @@ void Method() ...@@ -1398,7 +1398,7 @@ void Method()
} }
"; ";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[WorkItem(537765, "DevDiv")] [WorkItem(537765, "DevDiv")]
...@@ -1425,7 +1425,7 @@ public async Task Comment25() ...@@ -1425,7 +1425,7 @@ public async Task Comment25()
} }
"; ";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[WorkItem(537765, "DevDiv")] [WorkItem(537765, "DevDiv")]
...@@ -1449,7 +1449,7 @@ void Foo() ...@@ -1449,7 +1449,7 @@ void Foo()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1464,7 +1464,7 @@ void Foo() ...@@ -1464,7 +1464,7 @@ void Foo()
} }
}"; }";
await AssertFormatAsync(content, content).ConfigureAwait(true); await AssertFormatAsync(content, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1491,7 +1491,7 @@ void Foo() ...@@ -1491,7 +1491,7 @@ void Foo()
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1513,7 +1513,7 @@ void Foo() ...@@ -1513,7 +1513,7 @@ void Foo()
} }
}"; }";
await AssertFormatAsync(code, content).ConfigureAwait(true); await AssertFormatAsync(code, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1525,7 +1525,7 @@ public async Task Comment30() ...@@ -1525,7 +1525,7 @@ public async Task Comment30()
var code = @" var code = @"
// Test"; // Test";
await AssertFormatAsync(code, content).ConfigureAwait(true); await AssertFormatAsync(code, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1553,7 +1553,7 @@ static void Main(string[] args) ...@@ -1553,7 +1553,7 @@ static void Main(string[] args)
} }
"; ";
await AssertFormatAsync(code, content).ConfigureAwait(true); await AssertFormatAsync(code, content);
} }
[WorkItem(538703, "DevDiv")] [WorkItem(538703, "DevDiv")]
...@@ -1578,7 +1578,7 @@ public async Task Comment32() ...@@ -1578,7 +1578,7 @@ public async Task Comment32()
} }
"; ";
await AssertFormatAsync(code, content).ConfigureAwait(true); await AssertFormatAsync(code, content);
} }
[WorkItem(542316, "DevDiv")] [WorkItem(542316, "DevDiv")]
...@@ -1615,7 +1615,7 @@ static void Main(string[] args) ...@@ -1615,7 +1615,7 @@ static void Main(string[] args)
} }
"; ";
await AssertFormatAsync(code, content).ConfigureAwait(true); await AssertFormatAsync(code, content);
} }
[WorkItem(542546, "DevDiv")] [WorkItem(542546, "DevDiv")]
...@@ -1623,7 +1623,7 @@ static void Main(string[] args) ...@@ -1623,7 +1623,7 @@ static void Main(string[] args)
public async Task FormatInvalidCode_1() public async Task FormatInvalidCode_1()
{ {
var content = @"> Roslyn.Utilities.dll! Basic"; var content = @"> Roslyn.Utilities.dll! Basic";
await AssertFormatAsync(content, content).ConfigureAwait(true); await AssertFormatAsync(content, content);
} }
[WorkItem(542546, "DevDiv")] [WorkItem(542546, "DevDiv")]
...@@ -1632,7 +1632,7 @@ public async Task FormatInvalidCode_2() ...@@ -1632,7 +1632,7 @@ public async Task FormatInvalidCode_2()
{ {
var content = @"> Roslyn.Utilities.dll! Line 43 + 0x5 bytes Basic"; var content = @"> Roslyn.Utilities.dll! Line 43 + 0x5 bytes Basic";
var expectedContent = @"> Roslyn.Utilities.dll! Line 43 + 0x5 bytes Basic"; var expectedContent = @"> Roslyn.Utilities.dll! Line 43 + 0x5 bytes Basic";
await AssertFormatAsync(expectedContent, content).ConfigureAwait(true); await AssertFormatAsync(expectedContent, content);
} }
[WorkItem(537895, "DevDiv")] [WorkItem(537895, "DevDiv")]
...@@ -1669,7 +1669,7 @@ static void Main(string[] args) ...@@ -1669,7 +1669,7 @@ static void Main(string[] args)
#endregion #endregion
} }
}"; }";
await AssertFormatAsync(expectedContent, content).ConfigureAwait(true); await AssertFormatAsync(expectedContent, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1703,7 +1703,7 @@ static void Main(string[] args) ...@@ -1703,7 +1703,7 @@ static void Main(string[] args)
} }
}"; }";
await AssertFormatAsync(expected, content).ConfigureAwait(true); await AssertFormatAsync(expected, content);
} }
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)] [Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
...@@ -1714,7 +1714,7 @@ public async Task NewLineOptions_LineFeedOnly() ...@@ -1714,7 +1714,7 @@ public async Task NewLineOptions_LineFeedOnly()
// replace all EOL trivia with elastic markers to force the formatter to add EOL back // replace all EOL trivia with elastic markers to force the formatter to add EOL back
tree = tree.ReplaceTrivia(tree.DescendantTrivia().Where(tr => tr.IsKind(SyntaxKind.EndOfLineTrivia)), (o, r) => SyntaxFactory.ElasticMarker); tree = tree.ReplaceTrivia(tree.DescendantTrivia().Where(tr => tr.IsKind(SyntaxKind.EndOfLineTrivia)), (o, r) => SyntaxFactory.ElasticMarker);
var formatted = await Formatter.FormatAsync(tree, DefaultWorkspace, DefaultWorkspace.Options.WithChangedOption(FormattingOptions.NewLine, LanguageNames.CSharp, "\n")).ConfigureAwait(true); var formatted = await Formatter.FormatAsync(tree, DefaultWorkspace, DefaultWorkspace.Options.WithChangedOption(FormattingOptions.NewLine, LanguageNames.CSharp, "\n"));
var actual = formatted.ToFullString(); var actual = formatted.ToFullString();
var expected = "class C\n{\n}"; var expected = "class C\n{\n}";
...@@ -1756,7 +1756,7 @@ class F ...@@ -1756,7 +1756,7 @@ class F
.WithLeadingTrivia(SyntaxFactory.TriviaList()) .WithLeadingTrivia(SyntaxFactory.TriviaList())
.WithAdditionalAnnotations(SyntaxAnnotation.ElasticAnnotation)); .WithAdditionalAnnotations(SyntaxAnnotation.ElasticAnnotation));
var formatted = await Formatter.FormatAsync(tree, DefaultWorkspace, DefaultWorkspace.Options.WithChangedOption(FormattingOptions.UseTabs, LanguageNames.CSharp, true)).ConfigureAwait(true); var formatted = await Formatter.FormatAsync(tree, DefaultWorkspace, DefaultWorkspace.Options.WithChangedOption(FormattingOptions.UseTabs, LanguageNames.CSharp, true));
var actual = formatted.ToFullString(); var actual = formatted.ToFullString();
Assert.Equal(expected, actual); Assert.Equal(expected, actual);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册