public void DeletePageResourceNames() { moq::Mock <Pages.PagesClient> mockGrpcClient = new moq::Mock <Pages.PagesClient>(moq::MockBehavior.Strict); DeletePageRequest request = new DeletePageRequest { PageName = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeletePage(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); PagesClient client = new PagesClientImpl(mockGrpcClient.Object, null); client.DeletePage(request.PageName); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for DeletePage</summary> public void DeletePageRequestObject() { // Snippet: DeletePage(DeletePageRequest, CallSettings) // Create client PagesClient pagesClient = PagesClient.Create(); // Initialize request argument(s) DeletePageRequest request = new DeletePageRequest { PageName = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"), Force = false, }; // Make the request pagesClient.DeletePage(request); // End snippet }
public async stt::Task DeletePageResourceNamesAsync() { moq::Mock <Pages.PagesClient> mockGrpcClient = new moq::Mock <Pages.PagesClient>(moq::MockBehavior.Strict); DeletePageRequest request = new DeletePageRequest { PageName = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeletePageAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null)); PagesClient client = new PagesClientImpl(mockGrpcClient.Object, null); await client.DeletePageAsync(request.PageName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); await client.DeletePageAsync(request.PageName, st::CancellationToken.None); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for DeletePageAsync</summary> public async Task DeletePageRequestObjectAsync() { // Snippet: DeletePageAsync(DeletePageRequest, CallSettings) // Additional: DeletePageAsync(DeletePageRequest, CancellationToken) // Create client PagesClient pagesClient = await PagesClient.CreateAsync(); // Initialize request argument(s) DeletePageRequest request = new DeletePageRequest { PageName = PageName.FromProjectLocationAgentFlowPage("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"), Force = false, }; // Make the request await pagesClient.DeletePageAsync(request); // End snippet }