Stufe 4c (#764): Bezeichner auf Englisch - Typen, Methoden, Felder, Parameter, Locals, Testnamen
Mit Roslyn umbenannt (Verweise folgen, Zeichenketten bleiben unberuehrt). Nicht umbenannt, weil gespeichert oder ueber die API gebunden (Stufe 4e): Properties, Record-Parameter, Enum-Member sowie die Parameter der Endpunkt-Handler (Routen-/Query-Bindung ueber den Namen). Die JSON-Felder anonymer Objekte bleiben ausdruecklich benannt (JsonFilter: pfad). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
837a634a22
commit
77062facc9
@@ -35,9 +35,9 @@ public sealed class ShutdownTests : IDisposable
|
||||
/// seconds). If the test stays below two, the promise is kept without a
|
||||
/// slow build server turning it red.
|
||||
/// </summary>
|
||||
private static readonly TimeSpan Grenze = TimeSpan.FromSeconds(2);
|
||||
private static readonly TimeSpan Limit = TimeSpan.FromSeconds(2);
|
||||
|
||||
private AppHost NeuerHost(int port)
|
||||
private AppHost NewHost(int port)
|
||||
{
|
||||
var instancesDir = Path.Combine(_root, "Instances");
|
||||
var instancePath = Path.Combine(instancesDir, "Test");
|
||||
@@ -66,7 +66,7 @@ public sealed class ShutdownTests : IDisposable
|
||||
/// A free port from the operating system. A fixed number would let two test runs
|
||||
/// fail side by side — and those are exactly the errors you search for the longest.
|
||||
/// </summary>
|
||||
private static int FreierPort()
|
||||
private static int FreePort()
|
||||
{
|
||||
using var probe = new System.Net.Sockets.TcpListener(System.Net.IPAddress.Loopback, 0);
|
||||
probe.Start();
|
||||
@@ -76,10 +76,10 @@ public sealed class ShutdownTests : IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Beenden_wartet_nicht_auf_einen_offenen_Ereignisstrom()
|
||||
public async Task Shutdown_does_not_wait_for_an_open_event_stream()
|
||||
{
|
||||
var port = FreierPort();
|
||||
await using var host = NeuerHost(port);
|
||||
var port = FreePort();
|
||||
await using var host = NewHost(port);
|
||||
|
||||
var web = InstanceHttpHost.TryStart(host, NullLoggerFactory.Instance);
|
||||
web.ShouldNotBeNull();
|
||||
@@ -89,39 +89,39 @@ public sealed class ShutdownTests : IDisposable
|
||||
|
||||
// Really open the stream and wait for the first line: only then does
|
||||
// Kestrel hold the request, and only then does the test check what it wants to check.
|
||||
using var antwort = await client.GetAsync(
|
||||
using var answer = await client.GetAsync(
|
||||
$"http://127.0.0.1:{port}/events?token={Token}",
|
||||
HttpCompletionOption.ResponseHeadersRead);
|
||||
|
||||
antwort.EnsureSuccessStatusCode();
|
||||
answer.EnsureSuccessStatusCode();
|
||||
|
||||
await using var strom = await antwort.Content.ReadAsStreamAsync();
|
||||
using var leser = new StreamReader(strom);
|
||||
(await leser.ReadLineAsync()).ShouldBe(": bereit");
|
||||
await using var stream = await answer.Content.ReadAsStreamAsync();
|
||||
using var reader = new StreamReader(stream);
|
||||
(await reader.ReadLineAsync()).ShouldBe(": bereit");
|
||||
|
||||
var uhr = Stopwatch.StartNew();
|
||||
var clock = Stopwatch.StartNew();
|
||||
await web!.DisposeAsync();
|
||||
uhr.Stop();
|
||||
clock.Stop();
|
||||
|
||||
uhr.Elapsed.ShouldBeLessThan(Grenze,
|
||||
$"Das Beenden dauerte {uhr.Elapsed.TotalSeconds:0.0}s — der Ereignisstrom "
|
||||
clock.Elapsed.ShouldBeLessThan(Limit,
|
||||
$"Das Beenden dauerte {clock.Elapsed.TotalSeconds:0.0}s — der Ereignisstrom "
|
||||
+ "hat das Herunterfahren nicht bemerkt.");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Beenden_geht_auch_ohne_offene_Verbindung_zuegig()
|
||||
public async Task Shutdown_is_quick_even_without_an_open_connection()
|
||||
{
|
||||
var port = FreierPort();
|
||||
await using var host = NeuerHost(port);
|
||||
var port = FreePort();
|
||||
await using var host = NewHost(port);
|
||||
|
||||
var web = InstanceHttpHost.TryStart(host, NullLoggerFactory.Instance);
|
||||
web.ShouldNotBeNull();
|
||||
|
||||
var uhr = Stopwatch.StartNew();
|
||||
var clock = Stopwatch.StartNew();
|
||||
await web!.DisposeAsync();
|
||||
uhr.Stop();
|
||||
clock.Stop();
|
||||
|
||||
uhr.Elapsed.ShouldBeLessThan(Grenze);
|
||||
clock.Elapsed.ShouldBeLessThan(Limit);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -135,14 +135,14 @@ public sealed class ShutdownTests : IDisposable
|
||||
/// exists for.</para>
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Ein_belegter_Port_kostet_nur_die_Weboberflaeche()
|
||||
public async Task An_occupied_port_only_costs_the_web_UI()
|
||||
{
|
||||
var port = FreierPort();
|
||||
var port = FreePort();
|
||||
|
||||
using var blockierer = new System.Net.Sockets.TcpListener(System.Net.IPAddress.Loopback, port);
|
||||
blockierer.Start();
|
||||
|
||||
await using var host = NeuerHost(port);
|
||||
await using var host = NewHost(port);
|
||||
|
||||
await using var web = InstanceHttpHost.TryStart(host, NullLoggerFactory.Instance);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user