Skip to content

Commit 6086845

Browse files
committed
what!?
1 parent 09db277 commit 6086845

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/Bicep.LangServer.IntegrationTests/CompletionTests.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public async Task EmptyFileShouldProduceDeclarationCompletions()
6565

6666
var expected = JToken.Parse(expectedStr);
6767

68-
actual.Should().EqualWithJsonDiffOutput(TestContext, expected, GetGlobalCompletionSetPath(expectedSetName), actualLocation);
68+
actual.Should().EqualWithJsonDiffOutput(this.TestContext, expected, GetGlobalCompletionSetPath(expectedSetName), actualLocation);
6969
}
7070

7171
[DataTestMethod]
@@ -75,7 +75,7 @@ public async Task ValidateSnippetCompletionAfterPlaceholderReplacements(Completi
7575
{
7676
string pathPrefix = $"Completions/SnippetTemplates/{completionData.Prefix}";
7777

78-
var outputDirectory = FileHelper.SaveEmbeddedResourcesWithPathPrefix(TestContext, typeof(CompletionTests).Assembly, pathPrefix);
78+
var outputDirectory = FileHelper.SaveEmbeddedResourcesWithPathPrefix(this.TestContext, typeof(CompletionTests).Assembly, pathPrefix);
7979

8080
var bicepFileName = Path.Combine(outputDirectory, "main.bicep");
8181
var bicepSourceFileName = Path.Combine("src", "Bicep.LangServer.IntegrationTests", pathPrefix, Path.GetRelativePath(outputDirectory, bicepFileName));
@@ -195,7 +195,7 @@ public async Task String_segments_do_not_return_completions()
195195
'''|
196196
";
197197

198-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsEmpty);
198+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsEmpty);
199199
}
200200

201201
[TestMethod]
@@ -205,7 +205,7 @@ public async Task Completions_are_offered_in_string_expressions()
205205
var interpolatedString = 'abc${|true}def${|}ghi${res|}xyz'
206206
";
207207

208-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsNonEmpty);
208+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsNonEmpty);
209209
}
210210

211211
[TestMethod]
@@ -216,7 +216,7 @@ public async Task Completions_are_offered_immediately_before_and_after_comments(
216216
var test2 = |/* block comment */|
217217
";
218218

219-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsNonEmpty);
219+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsNonEmpty);
220220
}
221221

222222
[TestMethod]
@@ -232,7 +232,7 @@ public async Task Completions_are_not_offered_immediately_after_open_paren()
232232
output baz object = {|
233233
";
234234

235-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsEmpty);
235+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsEmpty);
236236
}
237237

238238
[TestMethod]
@@ -243,7 +243,7 @@ public async Task Completions_are_not_offered_inside_comments()
243243
var test2 = /|* block c|omment *|/
244244
";
245245

246-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsEmpty);
246+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsEmpty);
247247
}
248248

249249
[TestMethod]
@@ -415,7 +415,7 @@ public async Task Property_completions_include_descriptions()
415415
output string test2 = testRes.properties.|
416416
";
417417

418-
await RunCompletionScenarioTest(TestContext, fileWithCursors, completions =>
418+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, completions =>
419419
completions.Should().SatisfyRespectively(
420420
x => x!.OrderBy(d => d.SortText).Should().SatisfyRespectively(
421421
d => d.Documentation!.MarkupContent!.Value.Should().Contain("This is a property which supports reading AND writing!"),
@@ -467,7 +467,7 @@ static void AssertExistingKeywordCompletion(CompletionItem item)
467467
}
468468

469469

470-
await RunCompletionScenarioTest(TestContext, fileWithCursors, completions =>
470+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, completions =>
471471
completions.Should().SatisfyRespectively(
472472
x => x!.OrderBy(d => d.SortText).Should().SatisfyRespectively(d => AssertExistingKeywordCompletion(d)),
473473
x => x!.OrderBy(d => d.SortText).Should().SatisfyRespectively(d => AssertExistingKeywordCompletion(d)),
@@ -495,7 +495,7 @@ static void AssertPropertyNameCompletionsWithColons(CompletionList list)
495495
.OnlyContain(x => string.Equals(x.TextEdit!.TextEdit!.NewText, x.Label + ':'));
496496
}
497497

498-
await RunCompletionScenarioTest(TestContext, fileWithCursors, completions =>
498+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, completions =>
499499
completions.Should().SatisfyRespectively(
500500
l => AssertPropertyNameCompletionsWithColons(l!),
501501
l => AssertPropertyNameCompletionsWithColons(l!)));
@@ -521,7 +521,7 @@ static void AssertPropertyNameCompletionsWithoutColons(CompletionList list)
521521
}
522522
";
523523

524-
await RunCompletionScenarioTest(TestContext, fileWithCursors, completions =>
524+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, completions =>
525525
completions.Should().SatisfyRespectively(
526526
l => AssertPropertyNameCompletionsWithoutColons(l!),
527527
l => AssertPropertyNameCompletionsWithoutColons(l!)));
@@ -538,7 +538,7 @@ public async Task RequestCompletionsInResourceBodies_AtPositionsWhereNodeShouldN
538538
}
539539
|}
540540
";
541-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsEmpty);
541+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsEmpty);
542542
}
543543

544544
[TestMethod]
@@ -574,7 +574,7 @@ public async Task RequestCompletionsInProgram_AtPositionsWhereNodeShouldNotBeIns
574574
name: 'myRes'
575575
}
576576
";
577-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsEmpty);
577+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsEmpty);
578578
}
579579

580580
[TestMethod]
@@ -592,7 +592,7 @@ public async Task RequestCompletionsInObjects_AtPositionsWhereNodeShouldNotBeIns
592592
prop | : false
593593
| }
594594
";
595-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsEmpty);
595+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsEmpty);
596596
}
597597

598598
[TestMethod]
@@ -611,7 +611,7 @@ public async Task RequestCompletionsInArrays_AtPositionsWhereNodeShouldBeInserte
611611
| true
612612
| ]
613613
";
614-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsEmpty);
614+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsEmpty);
615615
}
616616

617617
[TestMethod]
@@ -622,7 +622,7 @@ public async Task RequestCompletionsInExpressions_AtPositionsWhereNodeShouldBeIn
622622
var binary = -1 | |+| | 2
623623
var ternary = true | |?| | 'yes' | |:| | 'no'
624624
";
625-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsEmpty);
625+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsEmpty);
626626
}
627627

628628
[TestMethod]
@@ -633,7 +633,7 @@ public async Task RequestCompletions_MatchingNodeIsBooleanOrIntegerOrNullLiteral
633633
var integerExp = |12|345| + |543|21|
634634
var nullLit = |n|ull|
635635
";
636-
await RunCompletionScenarioTest(TestContext, fileWithCursors, AssertAllCompletionsEmpty);
636+
await RunCompletionScenarioTest(this.TestContext, fileWithCursors, AssertAllCompletionsEmpty);
637637
}
638638

639639
private static async Task RunCompletionScenarioTest(TestContext testContext, string fileWithCursors, Action<IEnumerable<CompletionList?>> assertAction)
@@ -646,7 +646,7 @@ private static async Task RunCompletionScenarioTest(TestContext testContext, str
646646
assertAction(completions);
647647
}
648648

649-
private static Task RunCompletionScenarioTest(object testContext, object fileWithCursors)
649+
private static Task RunCompletionScenarioTest(object testContext, Action<IEnumerable<CompletionList?>> assertAction222)
650650
{
651651
/*
652652
* The compiler on GitHub actions seems to believe that we are only passing 2 arguments to this method.
@@ -712,7 +712,7 @@ private void ValidateCompletions(DataSet dataSet, string setName, List<(Position
712712
_ => GetGlobalCompletionSetPath(setName)
713713
};
714714

715-
actual.Should().EqualWithJsonDiffOutput(TestContext, expected, expectedLocation, actualLocation, "because ");
715+
actual.Should().EqualWithJsonDiffOutput(this.TestContext, expected, expectedLocation, actualLocation, "because ");
716716
}
717717

718718
private static string GetGlobalCompletionSetPath(string setName) => Path.Combine("src", "Bicep.Core.Samples", "Files", DataSet.TestCompletionsDirectory, GetFullSetName(setName));

0 commit comments

Comments
 (0)