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
@@ -33,7 +33,7 @@ public sealed class UrlGuardTests
|
||||
[InlineData("http://[fd00::1]/")]
|
||||
[InlineData("http://nas.local/")]
|
||||
[InlineData("http://dienst.internal/")]
|
||||
public void Adressen_im_lokalen_oder_privaten_Netz_werden_gesperrt(string url)
|
||||
public void Addresses_in_the_local_or_private_network_are_blocked(string url)
|
||||
{
|
||||
Validate(url, out var error).ShouldBeFalse($"'{url}' muss gesperrt sein");
|
||||
error.ShouldNotBeNull();
|
||||
@@ -44,7 +44,7 @@ public sealed class UrlGuardTests
|
||||
[InlineData("172.32.0.1")] // just above
|
||||
[InlineData("11.0.0.1")]
|
||||
[InlineData("8.8.8.8")]
|
||||
public void Oeffentliche_Adressen_gelten_nicht_als_privat(string host)
|
||||
public void Public_addresses_do_not_count_as_private(string host)
|
||||
{
|
||||
UrlGuard.IsPrivateOrLocal(host).ShouldBeFalse();
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public sealed class UrlGuardTests
|
||||
[InlineData("file:///C:/Windows/win.ini")]
|
||||
[InlineData("ftp://example.com/datei")]
|
||||
[InlineData("gopher://example.com/")]
|
||||
public void Nur_http_und_https_sind_erlaubt(string url)
|
||||
public void Only_http_and_https_are_allowed(string url)
|
||||
{
|
||||
Validate(url, out _).ShouldBeFalse();
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public sealed class UrlGuardTests
|
||||
[InlineData("https://news.example.com/artikel")]
|
||||
[InlineData("https://a.b.example.com/x")]
|
||||
[InlineData("https://reuters.com/")]
|
||||
public void Erlaubte_Domains_und_ihre_Subdomains_gehen_durch(string url)
|
||||
public void Allowed_domains_and_their_subdomains_go_through(string url)
|
||||
{
|
||||
Validate(url, out var error).ShouldBeTrue(error);
|
||||
}
|
||||
@@ -82,13 +82,13 @@ public sealed class UrlGuardTests
|
||||
[InlineData("https://notexample.com/x")]
|
||||
[InlineData("https://evil.com/x")]
|
||||
[InlineData("https://exampleXcom/x")]
|
||||
public void Aehnlich_aussehende_Domains_werden_abgelehnt(string url)
|
||||
public void Lookalike_domains_are_rejected(string url)
|
||||
{
|
||||
Validate(url, out _).ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Ohne_Whitelist_wird_nichts_durchgelassen()
|
||||
public void Without_whitelist_nothing_is_let_through()
|
||||
{
|
||||
UrlGuard.TryValidate("https://example.com", [], out _, out _).ShouldBeFalse();
|
||||
}
|
||||
@@ -98,14 +98,14 @@ public sealed class UrlGuardTests
|
||||
/// "mywww.example.com" became "myexample.com".
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void Die_www_Behandlung_verstuemmelt_keine_anderen_Hostnamen()
|
||||
public void The_www_handling_does_not_mangle_other_host_names()
|
||||
{
|
||||
UrlGuard.IsDomainAllowed("mywww.example.com", Allowed).ShouldBeTrue();
|
||||
UrlGuard.IsDomainAllowed("wwwxexample.com", Allowed).ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Ein_abschliessender_Punkt_im_Host_umgeht_die_Whitelist_nicht()
|
||||
public void A_trailing_dot_in_the_host_does_not_bypass_the_whitelist()
|
||||
{
|
||||
// "example.com." is the same host in DNS terms.
|
||||
UrlGuard.IsDomainAllowed("evil.com.", Allowed).ShouldBeFalse();
|
||||
@@ -113,7 +113,7 @@ public sealed class UrlGuardTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Grossschreibung_im_Host_spielt_keine_Rolle()
|
||||
public void Case_in_the_host_does_not_matter()
|
||||
{
|
||||
Validate("https://EXAMPLE.COM/x", out var error).ShouldBeTrue(error);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public sealed class UrlGuardTests
|
||||
[InlineData("")]
|
||||
[InlineData("kein-url")]
|
||||
[InlineData("/nur/ein/pfad")]
|
||||
public void Ungueltige_Eingaben_werden_abgelehnt(string? url)
|
||||
public void Invalid_inputs_are_rejected(string? url)
|
||||
{
|
||||
UrlGuard.TryValidate(url, Allowed, out _, out _).ShouldBeFalse();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user