diff --git a/src/EditorFeatures/CSharpTest/SimplifyInterpolation/SimplifyInterpolationTests.cs b/src/EditorFeatures/CSharpTest/SimplifyInterpolation/SimplifyInterpolationTests.cs index 14ec4ae09304c618ce419b74b19e686478f8cd4d..3a223112b21270742de05fcbb6abef3c66b1ecb0 100644 --- a/src/EditorFeatures/CSharpTest/SimplifyInterpolation/SimplifyInterpolationTests.cs +++ b/src/EditorFeatures/CSharpTest/SimplifyInterpolation/SimplifyInterpolationTests.cs @@ -528,6 +528,38 @@ void M(string someValue) { _ = $""prefix {someValue.PadLeft(3),3} suffix""; } +}"); + } + + [Fact] + public async Task PadLeftThenPadRight_WithoutAlignment() + { + await TestInRegularAndScriptAsync( +@"class C +{ + void M(string someValue) + { + _ = $""prefix {someValue.PadLeft(3){|Unnecessary:[||].PadRight(|}3{|Unnecessary:)|}} suffix""; + } +}", @"class C +{ + void M(string someValue) + { + _ = $""prefix {someValue.PadLeft(3),3} suffix""; + } +}"); + } + + [Fact] + public async Task PadLeftThenPadRight_WithAlignment() + { + await TestMissingAsync( +@"class C +{ + void M(string someValue) + { + _ = $""prefix {someValue.PadLeft(3)[||].PadRight(3),3} suffix""; + } }"); } }