|
27 | 27 | namespace Microsoft.PythonTools.Analysis.FluentAssertions { |
28 | 28 | [ExcludeFromCodeCoverage] |
29 | 29 | internal sealed class TextEditCollectionAssertions : SelfReferencingCollectionAssertions<TextEdit, TextEditCollectionAssertions> { |
30 | | - public TextEditCollectionAssertions(IEnumerable<TextEdit> references) : base(references) {} |
| 30 | + public TextEditCollectionAssertions(IEnumerable<TextEdit> references) : base(references) { } |
31 | 31 |
|
32 | 32 | protected override string Identifier => nameof(TextEdit) + "Collection"; |
33 | 33 |
|
34 | | - |
| 34 | + |
35 | 35 | [CustomAssertion] |
36 | 36 | public AndConstraint<TextEditCollectionAssertions> OnlyHaveTextEdit(string expectedText, (int startLine, int startCharacter, int endLine, int endCharacter) expectedRange, string because = "", params object[] reasonArgs) |
37 | | - => OnlyHaveTextEdits(new []{(expectedText, expectedRange)}, because, reasonArgs); |
| 37 | + => OnlyHaveTextEdits(new[] {(expectedText, expectedRange)}, because, reasonArgs); |
38 | 38 |
|
39 | 39 | [CustomAssertion] |
40 | 40 | public AndConstraint<TextEditCollectionAssertions> OnlyHaveTextEdits(params (string expectedText, (int startLine, int startCharacter, int endLine, int endCharacter) expectedRange)[] textEdits) |
@@ -64,14 +64,14 @@ public AndConstraint<TextEditCollectionAssertions> OnlyHaveTextEdits(IEnumerable |
64 | 64 |
|
65 | 65 | return new AndConstraint<TextEditCollectionAssertions>(this); |
66 | 66 | } |
67 | | - |
| 67 | + |
68 | 68 | [CustomAssertion] |
69 | 69 | public AndConstraint<TextEditCollectionAssertions> HaveTextEditAt(string expectedText, (int startLine, int startCharacter, int endLine, int endCharacter) expectedRange, string because = "", params object[] reasonArgs) { |
70 | 70 | var range = new Range { |
71 | 71 | start = new Position { line = expectedRange.startLine, character = expectedRange.startCharacter }, |
72 | 72 | end = new Position { line = expectedRange.endLine, character = expectedRange.endCharacter } |
73 | 73 | }; |
74 | | - |
| 74 | + |
75 | 75 | var errorMessage = GetHaveTextEditErrorMessage(expectedText, range); |
76 | 76 | if (errorMessage != string.Empty) { |
77 | 77 | var assertion = Execute.Assertion.BecauseOf(because, reasonArgs); |
@@ -99,8 +99,8 @@ private string GetHaveTextEditErrorMessage(string expectedText, Range expectedRa |
99 | 99 |
|
100 | 100 | if (candidatesWithRange.Length == 0) { |
101 | 101 | return "Expected {context:subject} to have text edit with newText \'{expectedText}\' in range {expectedRange}{reason}, but " |
102 | | - + (candidates.Length == 1 |
103 | | - ? $"it has range {candidates[0].range.ToString()}" |
| 102 | + + (candidates.Length == 1 |
| 103 | + ? $"it has range {candidates[0].range.ToString()}" |
104 | 104 | : $"they are in ranges {string.Join(", ", candidates.Select(te => te.range.ToString()))}"); |
105 | 105 | } |
106 | 106 |
|
|
0 commit comments