235 references to GetProperty
Aspire.Hosting.PostgreSQL.Tests (33)
AddPostgresTests.cs (33)
473var servers = document.RootElement.GetProperty("Servers"); 476Assert.Equal(pg1.Resource.Name, servers.GetProperty("1").GetProperty("Name").GetString()); 477Assert.Equal("Servers", servers.GetProperty("1").GetProperty("Group").GetString()); 478Assert.Equal("mypostgres1", servers.GetProperty("1").GetProperty("Host").GetString()); 479Assert.Equal(5432, servers.GetProperty("1").GetProperty("Port").GetInt32()); 480Assert.Equal("postgres", servers.GetProperty("1").GetProperty("Username").GetString()); 481Assert.Equal("prefer", servers.GetProperty("1").GetProperty("SSLMode").GetString()); 482Assert.Equal("postgres", servers.GetProperty("1").GetProperty("MaintenanceDB").GetString()); 483Assert.Equal($"echo '{pg1.Resource.PasswordParameter.Value}'", servers.GetProperty("1").GetProperty("PasswordExecCommand").GetString()); 486Assert.Equal(pg2.Resource.Name, servers.GetProperty("2").GetProperty("Name").GetString()); 487Assert.Equal("Servers", servers.GetProperty("2").GetProperty("Group").GetString()); 488Assert.Equal("mypostgres2", servers.GetProperty("2").GetProperty("Host").GetString()); 489Assert.Equal(5432, servers.GetProperty("2").GetProperty("Port").GetInt32()); 490Assert.Equal("myuser", servers.GetProperty("2").GetProperty("Username").GetString()); 491Assert.Equal("prefer", servers.GetProperty("2").GetProperty("SSLMode").GetString()); 492Assert.Equal("postgres", servers.GetProperty("2").GetProperty("MaintenanceDB").GetString()); 493Assert.Equal($"echo '{pg2.Resource.PasswordParameter.Value}'", servers.GetProperty("2").GetProperty("PasswordExecCommand").GetString());
Diagnostics.FunctionalTests (11)
DeveloperExceptionPageSampleTest.cs (11)
55Assert.Contains("System.Exception: Demonstration exception.", exceptionNode.GetProperty("details").GetString()); 56Assert.Equal("application/json", exceptionNode.GetProperty("headers").GetProperty("Accept")[0].GetString()); 57Assert.Equal("localhost", exceptionNode.GetProperty("headers").GetProperty("Host")[0].GetString()); 58Assert.Equal("/", exceptionNode.GetProperty("path").GetString()); 59Assert.Equal("Endpoint display name", exceptionNode.GetProperty("endpoint").GetString()); 60Assert.Equal("Value1", exceptionNode.GetProperty("routeValues").GetProperty("routeValue1").GetString()); 61Assert.Equal("Value2", exceptionNode.GetProperty("routeValues").GetProperty("routeValue2").GetString());
dotnet-openapi (1)
Commands\BaseCommand.cs (1)
464var packageVersionsElement = packageVersionDocument.RootElement.GetProperty("Packages");
JwtBearerSample (1)
Startup.cs (1)
80var todo = new Todo() { Description = obj.GetProperty("Description").GetString(), Owner = context.User.Identity.Name };
Microsoft.AspNetCore.Authentication.Test (8)
JwtBearerTests.cs (4)
957Assert.Equal(token.ValidTo, dom.RootElement.GetProperty("expires").GetDateTimeOffset()); 958Assert.Equal(token.ValidFrom, dom.RootElement.GetProperty("issued").GetDateTimeOffset()); 999Assert.Equal(JsonValueKind.Null, dom.RootElement.GetProperty("issued").ValueKind); 1001var expiresElement = dom.RootElement.GetProperty("expires");
JwtBearerTests_Handler.cs (4)
901Assert.Equal(token.ValidTo, dom.RootElement.GetProperty("expires").GetDateTimeOffset()); 902Assert.Equal(token.ValidFrom, dom.RootElement.GetProperty("issued").GetDateTimeOffset()); 942Assert.Equal(JsonValueKind.Null, dom.RootElement.GetProperty("issued").ValueKind); 944var expiresElement = dom.RootElement.GetProperty("expires");
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (54)
ServerStreamingServerCallHandlerTests.cs (10)
68Assert.Equal("Hello TestName! 1", responseJson1.RootElement.GetProperty("message").GetString()); 75Assert.Equal("Hello TestName! 2", responseJson2.RootElement.GetProperty("message").GetString()); 112Assert.Equal("Hello TestName! 1", responseJson1.RootElement.GetProperty("message").GetString()); 116Assert.Equal("Exception was thrown by handler.", responseJson2.RootElement.GetProperty("message").GetString()); 117Assert.Equal(2, responseJson2.RootElement.GetProperty("code").GetInt32()); 154Assert.Equal("Hello TestName! 1", responseJson1.RootElement.GetProperty("message").GetString()); 158Assert.Equal("Detail!", responseJson2.RootElement.GetProperty("message").GetString()); 159Assert.Equal((int)StatusCode.Aborted, responseJson2.RootElement.GetProperty("code").GetInt32()); 195Assert.Equal("Exception was thrown by handler. Exception: Exception!", responseJson.RootElement.GetProperty("message").GetString()); 196Assert.Equal(2, responseJson.RootElement.GetProperty("code").GetInt32());
UnaryServerCallHandlerTests.cs (44)
82Assert.Equal("Hello TestName!", responseJson.RootElement.GetProperty("message").GetString()); 717Assert.Equal("", responseJson.RootElement.GetProperty("message").GetString()); 749Assert.Equal(expectedError, responseJson.RootElement.GetProperty("message").GetString()); 750Assert.Equal((int)StatusCode.InvalidArgument, responseJson.RootElement.GetProperty("code").GetInt32()); 787Assert.Equal(expectedError, responseJson.RootElement.GetProperty("message").GetString()); 788Assert.Equal((int)StatusCode.InvalidArgument, responseJson.RootElement.GetProperty("code").GetInt32()); 817Assert.Equal(expectedError, responseJson.RootElement.GetProperty("message").GetString()); 818Assert.Equal((int)StatusCode.InvalidArgument, responseJson.RootElement.GetProperty("code").GetInt32()); 841Assert.Equal("Detail!", responseJson.RootElement.GetProperty("message").GetString()); 842Assert.Equal((int)StatusCode.Unauthenticated, responseJson.RootElement.GetProperty("code").GetInt32()); 866Assert.Equal("Detail!", responseJson.RootElement.GetProperty("message").GetString()); 867Assert.Equal((int)StatusCode.Unauthenticated, responseJson.RootElement.GetProperty("code").GetInt32()); 933Assert.Equal(123, responseJson.RootElement.GetProperty("code").GetInt32()); 934Assert.Equal("This is a message", responseJson.RootElement.GetProperty("message").GetString()); 936var details = responseJson.RootElement.GetProperty("details").EnumerateArray().ToArray(); 940Assert.Equal("type.googleapis.com/google.rpc.DebugInfo", d.GetProperty("@type").GetString()); 941Assert.Equal("This is some debugging information", d.GetProperty("detail").GetString()); 945Assert.Equal("type.googleapis.com/google.rpc.RequestInfo", d.GetProperty("@type").GetString()); 946Assert.Equal("request-id", d.GetProperty("requestId").GetString()); 950Assert.Equal("type.googleapis.com/google.rpc.BadRequest", d.GetProperty("@type").GetString()); 951Assert.Equal(1, d.GetProperty("fieldViolations").GetArrayLength()); 1011Assert.Equal(123, responseJson.RootElement.GetProperty("code").GetInt32()); 1012Assert.Equal("This is a message", responseJson.RootElement.GetProperty("message").GetString()); 1014var details = responseJson.RootElement.GetProperty("details").EnumerateArray().ToArray(); 1018Assert.Equal("type.googleapis.com/google.rpc.DebugInfo", d.GetProperty("@type").GetString()); 1019Assert.Equal("This is some debugging information", d.GetProperty("detail").GetString()); 1023Assert.Equal("type.googleapis.com/google.rpc.RequestInfo", d.GetProperty("@type").GetString()); 1024Assert.Equal("request-id", d.GetProperty("requestId").GetString()); 1028Assert.Equal("type.googleapis.com/google.rpc.BadRequest", d.GetProperty("@type").GetString()); 1029Assert.Equal(1, d.GetProperty("fieldViolations").GetArrayLength()); 1053Assert.Equal("Exception was thrown by handler.", responseJson.RootElement.GetProperty("message").GetString()); 1054Assert.Equal((int)StatusCode.Unknown, responseJson.RootElement.GetProperty("code").GetInt32()); 1083Assert.Equal("Exception was thrown by handler. InvalidOperationException: Error!", responseJson.RootElement.GetProperty("message").GetString()); 1084Assert.Equal((int)StatusCode.Unknown, responseJson.RootElement.GetProperty("code").GetInt32()); 1112Assert.Equal(@"Detail!", responseJson.RootElement.GetProperty("message").GetString()); 1113Assert.Equal((int)StatusCode.Unauthenticated, responseJson.RootElement.GetProperty("code").GetInt32()); 1155Assert.Equal(@"Hello World!", responseJson.RootElement.GetProperty("message").GetString()); 1209Assert.Equal($"Hello {requestContent.Length}!", responseJson.RootElement.GetProperty("message").GetString()); 1236Assert.Equal("Unable to deserialize null to Int32Value.", responseJson.RootElement.GetProperty("message").GetString()); 1475Assert.Equal("Exception was thrown by handler.", responseJson.RootElement.GetProperty("message").GetString()); 1476Assert.Equal((int)StatusCode.Unknown, responseJson.RootElement.GetProperty("code").GetInt32()); 1737var anyMessage = responseJson.RootElement.GetProperty("anyMessage"); 1738Assert.Equal("type.googleapis.com/google.protobuf.StringValue", anyMessage.GetProperty("@type").GetString()); 1739Assert.Equal("A value!", anyMessage.GetProperty("value").GetString());
Microsoft.AspNetCore.Http.Abstractions.Tests (10)
HttpValidationProblemDetailsJsonConverterTest.cs (10)
35Assert.Equal(problemDetails.Type, document.RootElement.GetProperty("type").GetString()); 36Assert.Equal(problemDetails.Title, document.RootElement.GetProperty("title").GetString()); 37Assert.Equal(problemDetails.Status, document.RootElement.GetProperty("status").GetInt32()); 38Assert.Equal(problemDetails.Detail, document.RootElement.GetProperty("detail").GetString()); 39Assert.Equal(problemDetails.Instance, document.RootElement.GetProperty("instance").GetString()); 40Assert.Equal((string)problemDetails.Extensions["traceId"]!, document.RootElement.GetProperty("traceId").GetString()); 41var errorsElement = document.RootElement.GetProperty("errors"); 42Assert.Equal("error0", errorsElement.GetProperty("key0")[0].GetString()); 43Assert.Equal("error1", errorsElement.GetProperty("key1")[0].GetString()); 44Assert.Equal("error2", errorsElement.GetProperty("key1")[1].GetString());
Microsoft.AspNetCore.Http.Extensions.Tests (2)
ProblemDetailsDefaultWriterTest.cs (2)
536Assert.Equal(expectedExtension.GetProperty("data").GetString(), value.GetProperty("data").GetString());
Microsoft.AspNetCore.Identity.FunctionalTests (74)
MapIdentityApiTests.cs (74)
116var tokenType = loginContent.GetProperty("tokenType").GetString(); 117var accessToken = loginContent.GetProperty("accessToken").GetString(); 118var expiresIn = loginContent.GetProperty("expiresIn").GetDouble(); 148var tokenType = loginContent.GetProperty("token_type").GetString(); 149var accessToken = loginContent.GetProperty("access_token").GetString(); 150var expiresIn = loginContent.GetProperty("expires_in").GetDouble(); 183var accessToken = loginContent.GetProperty("accessToken").GetString(); 184var expiresIn = loginContent.GetProperty("expiresIn").GetDouble(); 262var accessToken = loginContent.GetProperty("accessToken").GetString(); 297var refreshToken = loginContent.GetProperty("refreshToken").GetString(); 301var accessToken = refreshContent.GetProperty("accessToken").GetString(); 343var refreshToken = loginContent.GetProperty("refreshToken").GetString(); 344var accessToken = loginContent.GetProperty("refreshToken").GetString(); 367refreshToken = refreshContent.GetProperty("refreshToken").GetString(); 371accessToken = refreshContent.GetProperty("accessToken").GetString(); 416var accessToken = refreshContent.GetProperty("accessToken").GetString(); 673var accessToken = loginContent.GetProperty("accessToken").GetString(); 674var refreshToken = loginContent.GetProperty("refreshToken").GetString(); 692Assert.False(twoFactorKeyContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 693Assert.False(twoFactorKeyContent.GetProperty("isMachineRemembered").GetBoolean()); 695var sharedKey = twoFactorKeyContent.GetProperty("sharedKey").GetString(); 704Assert.True(enable2faContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 705Assert.False(enable2faContent.GetProperty("isMachineRemembered").GetBoolean()); 731var accessToken = loginContent.GetProperty("accessToken").GetString(); 736var sharedKey = twoFactorKeyContent.GetProperty("sharedKey").GetString(); 745Assert.True(enable2faContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 747var recoveryCodes = enable2faContent.GetProperty("recoveryCodes").EnumerateArray().Select(e => e.GetString()).ToArray(); 758var recoveryAccessToken = recoveryLoginContent.GetProperty("accessToken").GetString(); 765Assert.False(disable2faContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 783var accessToken = loginContent.GetProperty("accessToken").GetString(); 788var sharedKey = twoFactorKeyContent.GetProperty("sharedKey").GetString(); 800Assert.True(enable2faContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 804Assert.False(resetKeyContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 806var resetSharedKey = resetKeyContent.GetProperty("sharedKey").GetString(); 817Assert.True(enable2faContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 830var accessToken = loginContent.GetProperty("accessToken").GetString(); 835var sharedKey = twoFactorKeyContent.GetProperty("sharedKey").GetString(); 844var recoveryCodes = enable2faContent.GetProperty("recoveryCodes").EnumerateArray().Select(e => e.GetString()).ToArray(); 845Assert.Equal(10, enable2faContent.GetProperty("recoveryCodesLeft").GetInt32()); 860var recoveryAccessToken = recoveryLoginContent.GetProperty("accessToken").GetString(); 867Assert.Equal(8, updated2faContent.GetProperty("recoveryCodesLeft").GetInt32()); 868Assert.Null(updated2faContent.GetProperty("recoveryCodes").GetString()); 875var resetRecoveryCodes = resetRecoveryContent.GetProperty("recoveryCodes").EnumerateArray().Select(e => e.GetString()).ToArray(); 876Assert.Equal(10, resetRecoveryContent.GetProperty("recoveryCodesLeft").GetInt32()); 901Assert.False(twoFactorKeyContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 902Assert.False(twoFactorKeyContent.GetProperty("isMachineRemembered").GetBoolean()); 904var sharedKey = twoFactorKeyContent.GetProperty("sharedKey").GetString(); 913Assert.True(enable2faContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 914Assert.False(enable2faContent.GetProperty("isMachineRemembered").GetBoolean()); 925Assert.True(session2faContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 926Assert.False(session2faContent.GetProperty("isMachineRemembered").GetBoolean()); 934Assert.True(session2faContent2.GetProperty("isTwoFactorEnabled").GetBoolean()); 935Assert.False(session2faContent2.GetProperty("isMachineRemembered").GetBoolean()); 943Assert.True(persistent2faContent.GetProperty("isTwoFactorEnabled").GetBoolean()); 944Assert.True(persistent2faContent.GetProperty("isMachineRemembered").GetBoolean()); 1040Assert.Equal(Email, infoResponse.GetProperty("email").GetString()); 1041Assert.True(infoResponse.GetProperty("isEmailConfirmed").GetBoolean()); 1058Assert.Equal(Email, infoPostContent.GetProperty("email").GetString()); 1059Assert.True(infoPostContent.GetProperty("isEmailConfirmed").GetBoolean()); 1085Assert.Equal(newEmail, infoAfterEmailChange.GetProperty("email").GetString()); 1100Assert.Equal(newEmail, infoAfterFinalLogin.GetProperty("email").GetString()); 1101Assert.True(infoAfterFinalLogin.GetProperty("isEmailConfirmed").GetBoolean()); 1136Assert.Equal(Email, infoResponse.GetProperty("email").GetString()); 1152Assert.Equal(Email, infoPostContent.GetProperty("email").GetString()); 1174Assert.Equal(newEmail, infoAfterEmailChange.GetProperty("email").GetString()); 1186Assert.Equal(newEmail, infoAfterFinalLogin.GetProperty("email").GetString()); 1251Assert.Equal(Email, infoPostContent.GetProperty("email").GetString()); 1252Assert.False(infoPostContent.GetProperty("isEmailConfirmed").GetBoolean()); 1270Assert.Equal(newEmail, infoGetContent.GetProperty("email").GetString()); 1271Assert.True(infoGetContent.GetProperty("isEmailConfirmed").GetBoolean()); 1356=> claims.EnumerateArray().Single(e => e.GetProperty("type").GetString() == name).GetProperty("value").GetString(); 1396var accessToken = loginContent.GetProperty("accessToken").GetString(); 1397var refreshToken = loginContent.GetProperty("refreshToken").GetString();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (8)
HttpsTests.cs (8)
164var protocol = (SslProtocols)result.GetProperty("protocol").GetInt32(); 169var cipherAlgorithm = (CipherAlgorithmType)result.GetProperty("cipherAlgorithm").GetInt32(); 173var cipherStrength = result.GetProperty("cipherStrength").GetInt32(); 177var hashAlgorithm = (HashAlgorithmType)result.GetProperty("hashAlgorithm").GetInt32(); 181var hashStrength = result.GetProperty("hashStrength").GetInt32(); 185var keyExchangeAlgorithm = (ExchangeAlgorithmType)result.GetProperty("keyExchangeAlgorithm").GetInt32(); 189var keyExchangeStrength = result.GetProperty("keyExchangeStrength").GetInt32(); 194var hostName = result.GetProperty("hostName").ToString();
Microsoft.Build (3)
Construction\Solution\SolutionFile.cs (3)
636foreach (JsonElement project in solution.GetProperty("projects").EnumerateArray()) 660solution = text.RootElement.GetProperty("solution"); 661return FileUtilities.GetFullPath(solution.GetProperty("path").GetString(), Path.GetDirectoryName(solutionFilterFile));
Microsoft.CodeAnalysis.LanguageServer.Protocol (8)
Protocol\Internal\Converters\ClassifiedTextRunConverter.cs (4)
25var classificationTypeName = data.GetProperty(nameof(ClassifiedTextRun.ClassificationTypeName)).GetString(); 26var text = data.GetProperty(nameof(ClassifiedTextRun.Text)).GetString(); 27var markerTagType = data.GetProperty(nameof(ClassifiedTextRun.MarkerTagType)).GetString(); 28var style = (ClassifiedTextRunStyle)(data.GetProperty(nameof(ClassifiedTextRun.Style)).GetInt32());
Protocol\Internal\Converters\ImageIdConverter.cs (2)
26var guid = root.GetProperty(nameof(ImageId.Guid)).GetString() ?? throw new JsonException(); 27var id = root.GetProperty(nameof(ImageId.Id)).GetInt32();
Protocol\Internal\Converters\ObjectContentConverter.cs (1)
50var type = data.GetProperty(TypeProperty).GetString() ?? throw new JsonException();
RoslynLanguageServer.cs (1)
198var uriToken = textDocumentToken.GetProperty("uri");
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
MSBuild\MSBuildProjectLoader.SolutionFilterReader.cs (3)
28var solution = document.RootElement.GetProperty("solution"); 30var solutionPath = solution.GetProperty("path").GetString()?.Replace('\\', Path.DirectorySeparatorChar); 57foreach (var project in solution.GetProperty("projects").EnumerateArray())
Negotiate.Client (4)
Controllers\AuthTestController.cs (4)
286if (string.IsNullOrEmpty(details.GetProperty("name").GetString())) 292if (string.IsNullOrEmpty(details.GetProperty("authenticationType").GetString())) 306if (!string.IsNullOrEmpty(details.GetProperty("name").GetString())) 312if (!string.IsNullOrEmpty(details.GetProperty("authenticationType").GetString()))
Templates.Blazor.Tests (3)
src\ProjectTemplates\Shared\Project.cs (3)
321var profiles = launchSettings.RootElement.GetProperty("profiles"); 333if (actualProfile.Value.GetProperty("commandName").GetString() == "Project") 335var applicationUrl = actualProfile.Value.GetProperty("applicationUrl");
Templates.Blazor.WebAssembly.Auth.Tests (3)
src\ProjectTemplates\Shared\Project.cs (3)
321var profiles = launchSettings.RootElement.GetProperty("profiles"); 333if (actualProfile.Value.GetProperty("commandName").GetString() == "Project") 335var applicationUrl = actualProfile.Value.GetProperty("applicationUrl");
Templates.Blazor.WebAssembly.Tests (3)
src\ProjectTemplates\Shared\Project.cs (3)
321var profiles = launchSettings.RootElement.GetProperty("profiles"); 333if (actualProfile.Value.GetProperty("commandName").GetString() == "Project") 335var applicationUrl = actualProfile.Value.GetProperty("applicationUrl");
Templates.Mvc.Tests (3)
src\ProjectTemplates\Shared\Project.cs (3)
321var profiles = launchSettings.RootElement.GetProperty("profiles"); 333if (actualProfile.Value.GetProperty("commandName").GetString() == "Project") 335var applicationUrl = actualProfile.Value.GetProperty("applicationUrl");
Templates.Tests (3)
src\ProjectTemplates\Shared\Project.cs (3)
321var profiles = launchSettings.RootElement.GetProperty("profiles"); 333if (actualProfile.Value.GetProperty("commandName").GetString() == "Project") 335var applicationUrl = actualProfile.Value.GetProperty("applicationUrl");