public async stt::Task ListAsync() { moq::Mock <RegionNetworkEndpointGroups.RegionNetworkEndpointGroupsClient> mockGrpcClient = new moq::Mock <RegionNetworkEndpointGroups.RegionNetworkEndpointGroupsClient>(moq::MockBehavior.Strict); ListRegionNetworkEndpointGroupsRequest request = new ListRegionNetworkEndpointGroupsRequest { Region = "regionedb20d96", Project = "projectaa6ff846", }; NetworkEndpointGroupList expectedResponse = new NetworkEndpointGroupList { Id = "id74b70bb8", Kind = "kindf7aa39d9", Warning = new Warning(), NextPageToken = "next_page_tokendbee0940", Items = { new NetworkEndpointGroup(), }, SelfLink = "self_link7e87f12d", }; mockGrpcClient.Setup(x => x.ListAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <NetworkEndpointGroupList>(stt::Task.FromResult(expectedResponse), null, null, null, null)); RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); NetworkEndpointGroupList responseCallSettings = await client.ListAsync(request.Project, request.Region, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); NetworkEndpointGroupList responseCancellationToken = await client.ListAsync(request.Project, request.Region, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void ListRequestObject() { moq::Mock <RegionNetworkEndpointGroups.RegionNetworkEndpointGroupsClient> mockGrpcClient = new moq::Mock <RegionNetworkEndpointGroups.RegionNetworkEndpointGroupsClient>(moq::MockBehavior.Strict); ListRegionNetworkEndpointGroupsRequest request = new ListRegionNetworkEndpointGroupsRequest { PageToken = "page_tokenf09e5538", MaxResults = 2806814450U, Region = "regionedb20d96", OrderBy = "order_byb4d33ada", Project = "projectaa6ff846", Filter = "filtere47ac9b2", ReturnPartialSuccess = false, }; NetworkEndpointGroupList expectedResponse = new NetworkEndpointGroupList { Id = "id74b70bb8", Kind = "kindf7aa39d9", Warning = new Warning(), NextPageToken = "next_page_tokendbee0940", Items = { new NetworkEndpointGroup(), }, SelfLink = "self_link7e87f12d", }; mockGrpcClient.Setup(x => x.List(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); NetworkEndpointGroupList response = client.List(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void List() { moq::Mock <RegionNetworkEndpointGroups.RegionNetworkEndpointGroupsClient> mockGrpcClient = new moq::Mock <RegionNetworkEndpointGroups.RegionNetworkEndpointGroupsClient>(moq::MockBehavior.Strict); ListRegionNetworkEndpointGroupsRequest request = new ListRegionNetworkEndpointGroupsRequest { Region = "regionedb20d96", Project = "projectaa6ff846", }; NetworkEndpointGroupList expectedResponse = new NetworkEndpointGroupList { Id = "id74b70bb8", Kind = "kindf7aa39d9", Warning = new Warning(), NextPageToken = "next_page_tokendbee0940", Items = { new NetworkEndpointGroup(), }, SelfLink = "self_link7e87f12d", }; mockGrpcClient.Setup(x => x.List(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); RegionNetworkEndpointGroupsClient client = new RegionNetworkEndpointGroupsClientImpl(mockGrpcClient.Object, null); NetworkEndpointGroupList response = client.List(request.Project, request.Region); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for List</summary> public void List() { // Snippet: List(string, CallSettings) // Create client GlobalNetworkEndpointGroupsClient globalNetworkEndpointGroupsClient = GlobalNetworkEndpointGroupsClient.Create(); // Initialize request argument(s) string project = ""; // Make the request NetworkEndpointGroupList response = globalNetworkEndpointGroupsClient.List(project); // End snippet }
/// <summary>Snippet for List</summary> public void List() { // Snippet: List(string, string, CallSettings) // Create client RegionNetworkEndpointGroupsClient regionNetworkEndpointGroupsClient = RegionNetworkEndpointGroupsClient.Create(); // Initialize request argument(s) string project = ""; string region = ""; // Make the request NetworkEndpointGroupList response = regionNetworkEndpointGroupsClient.List(project, region); // End snippet }
/// <summary>Snippet for ListAsync</summary> public async Task ListAsync() { // Snippet: ListAsync(string, CallSettings) // Additional: ListAsync(string, CancellationToken) // Create client GlobalNetworkEndpointGroupsClient globalNetworkEndpointGroupsClient = await GlobalNetworkEndpointGroupsClient.CreateAsync(); // Initialize request argument(s) string project = ""; // Make the request NetworkEndpointGroupList response = await globalNetworkEndpointGroupsClient.ListAsync(project); // End snippet }
/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListGlobalNetworkEndpointGroupsRequest, CallSettings) // Create client GlobalNetworkEndpointGroupsClient globalNetworkEndpointGroupsClient = GlobalNetworkEndpointGroupsClient.Create(); // Initialize request argument(s) ListGlobalNetworkEndpointGroupsRequest request = new ListGlobalNetworkEndpointGroupsRequest { PageToken = "", MaxResults = 0U, Filter = "", OrderBy = "", Project = "", ReturnPartialSuccess = false, }; // Make the request NetworkEndpointGroupList response = globalNetworkEndpointGroupsClient.List(request); // End snippet }
/// <summary>Snippet for ListAsync</summary> public async Task ListRequestObjectAsync() { // Snippet: ListAsync(ListGlobalNetworkEndpointGroupsRequest, CallSettings) // Additional: ListAsync(ListGlobalNetworkEndpointGroupsRequest, CancellationToken) // Create client GlobalNetworkEndpointGroupsClient globalNetworkEndpointGroupsClient = await GlobalNetworkEndpointGroupsClient.CreateAsync(); // Initialize request argument(s) ListGlobalNetworkEndpointGroupsRequest request = new ListGlobalNetworkEndpointGroupsRequest { PageToken = "", MaxResults = 0U, Filter = "", OrderBy = "", Project = "", ReturnPartialSuccess = false, }; // Make the request NetworkEndpointGroupList response = await globalNetworkEndpointGroupsClient.ListAsync(request); // End snippet }