Add net10.0 assets and run some fixers (#875)

This commit is contained in:
Stephen Toub 2025-10-15 15:27:43 -04:00 • committed by GitHub
commit bfc0980ef5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 168 additions and 194 deletions

View file

@ -448,7 +448,7 @@ public class AuthorizeAttributeTests(ITestOutputHelper testOutputHelper) : Kestr
}
private ClaimsPrincipal CreateUser(string name, params string[] roles)
=> new ClaimsPrincipal(new ClaimsIdentity(
=> new(new ClaimsIdentity(
[new Claim("name", name), new Claim(ClaimTypes.NameIdentifier, name), .. roles.Select(role => new Claim("role", role))],
"TestAuthType", "name", "role"));

View file

@ -241,7 +241,7 @@ public abstract class MapMcpTests(ITestOutputHelper testOutputHelper) : KestrelI
}
private ClaimsPrincipal CreateUser(string name)
=> new ClaimsPrincipal(new ClaimsIdentity(
=> new(new ClaimsIdentity(
[new Claim("name", name), new Claim(ClaimTypes.NameIdentifier, name)],
"TestAuthType", "name", "role"));

View file

@ -556,7 +556,7 @@ public class StreamableHttpServerConformanceTests(ITestOutputHelper outputHelper
Assert.Equal(NotificationMethods.ResourceUpdatedNotification, notification.Method);
}
private static StringContent JsonContent(string json) => new StringContent(json, Encoding.UTF8, "application/json");
private static StringContent JsonContent(string json) => new(json, Encoding.UTF8, "application/json");
private static JsonTypeInfo<T> GetJsonTypeInfo<T>() => (JsonTypeInfo<T>)McpJsonUtilities.DefaultOptions.GetTypeInfo(typeof(T));
private static T AssertType<T>(JsonNode? jsonNode)