test: migrate AdminUI/ControlPlane/Runtime/Host tests to xunit.v3 (#756)
v2-ci / unit-tests (push) Failing after 13m22s
v2-ci / unit-tests (push) Failing after 13m22s
Akka.TestKit.Xunit2 -> Akka.TestKit.Xunit 1.5.62 (xunit.v3 TestKit; needs xunit.v3 3.2.2, set via VersionOverride on the four projects). Removes the xunit 2.9.3 pin. IAsyncLifetime returns ValueTask, SqlServerFactAttribute gains the source-info ctor, and xUnit1051 call sites pass TestContext.Current.CancellationToken. Test counts unchanged. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -23,18 +23,18 @@ public sealed class HoverSignatureTests
|
||||
[Fact] public async Task Hover_on_GetTag_returns_member_markdown()
|
||||
{
|
||||
// hover over the "GetTag" identifier in ctx.GetTag("A")
|
||||
var md = (await Svc.Hover(new HoverRequest("""return ctx.GetTag("A").Value;""", 1, 16))).Markdown;
|
||||
var md = (await Svc.Hover(new HoverRequest("""return ctx.GetTag("A").Value;""", 1, 16), TestContext.Current.CancellationToken)).Markdown;
|
||||
md.ShouldNotBeNull();
|
||||
md!.ShouldContain("GetTag");
|
||||
}
|
||||
|
||||
[Fact] public async Task Hover_on_nothing_returns_null()
|
||||
=> (await Svc.Hover(new HoverRequest(" ", 1, 1))).Markdown.ShouldBeNull();
|
||||
=> (await Svc.Hover(new HoverRequest(" ", 1, 1), TestContext.Current.CancellationToken)).Markdown.ShouldBeNull();
|
||||
|
||||
[Fact] public void SignatureHelp_inside_GetTag_call_shows_the_signature()
|
||||
{
|
||||
// caret just after the open paren of ctx.GetTag(
|
||||
var sh = Svc.SignatureHelp(new SignatureHelpRequest("""return ctx.GetTag();""", 1, 19));
|
||||
var sh = Svc.SignatureHelp(new SignatureHelpRequest("""return ctx.GetTag();""", 1, 19), TestContext.Current.CancellationToken);
|
||||
sh.Label.ShouldNotBeNull();
|
||||
sh.Label!.ShouldContain("GetTag");
|
||||
sh.Parameters.ShouldNotBeNull();
|
||||
@@ -44,7 +44,7 @@ public sealed class HoverSignatureTests
|
||||
[Fact] public async Task Hover_on_a_plain_local_resolves_the_local_not_an_enclosing_member()
|
||||
{
|
||||
// hovering the local `x` (not a member) must resolve the LOCAL, and must NOT climb to GetTag/Value.
|
||||
var md = (await Svc.Hover(new HoverRequest("var x = 1;\nreturn ctx.GetTag(\"A\").Value + x;", 2, 33))).Markdown;
|
||||
var md = (await Svc.Hover(new HoverRequest("var x = 1;\nreturn ctx.GetTag(\"A\").Value + x;", 2, 33), TestContext.Current.CancellationToken)).Markdown;
|
||||
md.ShouldNotBeNull();
|
||||
md!.ShouldContain("x");
|
||||
md.ShouldNotContain("GetTag");
|
||||
@@ -54,12 +54,12 @@ public sealed class HoverSignatureTests
|
||||
{
|
||||
// ctx.Now is a property, not a call; use a parameterless method if one exists, else assert empty-safe behavior.
|
||||
// Deadband is static on ScriptContext (3 params) — instead verify a 0-arg edge via an empty arg list doesn't throw:
|
||||
var sh = Svc.SignatureHelp(new SignatureHelpRequest("return ctx.GetTag();", 1, 19));
|
||||
var sh = Svc.SignatureHelp(new SignatureHelpRequest("return ctx.GetTag();", 1, 19), TestContext.Current.CancellationToken);
|
||||
sh.ActiveParameter.ShouldBe(0); // clamped; no exception
|
||||
}
|
||||
|
||||
[Fact] public async Task Hover_with_out_of_range_position_returns_null_without_throwing()
|
||||
=> (await Svc.Hover(new HoverRequest("return 1;", 99, 99))).Markdown.ShouldBeNull();
|
||||
=> (await Svc.Hover(new HoverRequest("return 1;", 99, 99), TestContext.Current.CancellationToken)).Markdown.ShouldBeNull();
|
||||
|
||||
// ── tag-path hover (driven by the catalog) ─────────────────────────────────────────────────
|
||||
|
||||
@@ -67,7 +67,7 @@ public sealed class HoverSignatureTests
|
||||
{
|
||||
var svc = new ScriptAnalysisService(new FakeCatalog());
|
||||
// caret on the path literal inside ctx.GetTag("Line1.Speed")
|
||||
var md = (await svc.Hover(new HoverRequest("""return ctx.GetTag("Line1.Speed").Value;""", 1, 24))).Markdown;
|
||||
var md = (await svc.Hover(new HoverRequest("""return ctx.GetTag("Line1.Speed").Value;""", 1, 24), TestContext.Current.CancellationToken)).Markdown;
|
||||
md.ShouldNotBeNull();
|
||||
md!.ShouldContain("Line1.Speed");
|
||||
md.ShouldContain("Double");
|
||||
@@ -79,7 +79,7 @@ public sealed class HoverSignatureTests
|
||||
{
|
||||
var svc = new ScriptAnalysisService(new FakeCatalog());
|
||||
// caret on the path literal inside ctx.GetTag("Unknownz")
|
||||
var md = (await svc.Hover(new HoverRequest("""return ctx.GetTag("Unknownz").Value;""", 1, 22))).Markdown;
|
||||
var md = (await svc.Hover(new HoverRequest("""return ctx.GetTag("Unknownz").Value;""", 1, 22), TestContext.Current.CancellationToken)).Markdown;
|
||||
md.ShouldNotBeNull();
|
||||
md!.ShouldContain("Not a known");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user