private async Task <TResponse> SendResponseWithSecrets <TResponse>(Dictionary <string, string> secrets, TestClient <DaprClient> .TestGrpcRequest <TResponse> request) { var secretResponse = new Autogenerated.GetSecretResponse(); secretResponse.Data.Add(secrets); return(await request.CompleteWithMessageAsync(secretResponse)); }
private async Task SendResponseWithState <T>(T state, TestClient <DaprClient> .TestGrpcRequest request) { var stateData = TypeConverters.ToJsonByteString(state, new JsonSerializerOptions(JsonSerializerDefaults.Web)); var stateResponse = new GetStateResponse() { Data = stateData, Etag = "test", }; await request.CompleteWithMessageAsync(stateResponse); }
private async Task <TResponse> SendBulkResponseWithSecrets <TResponse>(Dictionary <string, string> secrets, TestClient <DaprClient> .TestGrpcRequest <TResponse> request) { var getBulkSecretResponse = new Autogenerated.GetBulkSecretResponse(); foreach (var secret in secrets) { var secretsResponse = new Autogenerated.SecretResponse(); secretsResponse.Secrets[secret.Key] = secret.Value; getBulkSecretResponse.Data.Add(secret.Key, secretsResponse); } return(await request.CompleteWithMessageAsync(getBulkSecretResponse)); }