public async Task UpdateExclusionAsync2() { Mock <ConfigServiceV2.ConfigServiceV2Client> mockGrpcClient = new Mock <ConfigServiceV2.ConfigServiceV2Client>(MockBehavior.Strict); UpdateExclusionRequest request = new UpdateExclusionRequest { ExclusionNameOneof = ExclusionNameOneof.From(new ExclusionName("[PROJECT]", "[EXCLUSION]")), Exclusion = new LogExclusion(), UpdateMask = new FieldMask(), }; LogExclusion expectedResponse = new LogExclusion { Name = "name2-1052831874", Description = "description-1724546052", Filter = "filter-1274492040", Disabled = true, }; mockGrpcClient.Setup(x => x.UpdateExclusionAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <LogExclusion>(Task.FromResult(expectedResponse), null, null, null, null)); ConfigServiceV2Client client = new ConfigServiceV2ClientImpl(mockGrpcClient.Object, null); LogExclusion response = await client.UpdateExclusionAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void UpdateExclusion() { Mock <ConfigServiceV2.ConfigServiceV2Client> mockGrpcClient = new Mock <ConfigServiceV2.ConfigServiceV2Client>(MockBehavior.Strict); UpdateExclusionRequest expectedRequest = new UpdateExclusionRequest { ExclusionNameOneof = ExclusionNameOneof.From(new ExclusionName("[PROJECT]", "[EXCLUSION]")), Exclusion = new LogExclusion(), UpdateMask = new FieldMask(), }; LogExclusion expectedResponse = new LogExclusion { Name = "name2-1052831874", Description = "description-1724546052", Filter = "filter-1274492040", Disabled = true, }; mockGrpcClient.Setup(x => x.UpdateExclusion(expectedRequest, It.IsAny <CallOptions>())) .Returns(expectedResponse); ConfigServiceV2Client client = new ConfigServiceV2ClientImpl(mockGrpcClient.Object, null); ExclusionNameOneof name = ExclusionNameOneof.From(new ExclusionName("[PROJECT]", "[EXCLUSION]")); LogExclusion exclusion = new LogExclusion(); FieldMask updateMask = new FieldMask(); LogExclusion response = client.UpdateExclusion(name, exclusion, updateMask); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task CreateExclusionAsync() { Mock <ConfigServiceV2.ConfigServiceV2Client> mockGrpcClient = new Mock <ConfigServiceV2.ConfigServiceV2Client>(MockBehavior.Strict); CreateExclusionRequest expectedRequest = new CreateExclusionRequest { ParentAsParentNameOneof = ParentNameOneof.From(new ProjectName("[PROJECT]")), Exclusion = new LogExclusion(), }; LogExclusion expectedResponse = new LogExclusion { Name = "name3373707", Description = "description-1724546052", Filter = "filter-1274492040", Disabled = true, }; mockGrpcClient.Setup(x => x.CreateExclusionAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <LogExclusion>(Task.FromResult(expectedResponse), null, null, null, null)); ConfigServiceV2Client client = new ConfigServiceV2ClientImpl(mockGrpcClient.Object, null); ParentNameOneof parent = ParentNameOneof.From(new ProjectName("[PROJECT]")); LogExclusion exclusion = new LogExclusion(); LogExclusion response = await client.CreateExclusionAsync(parent, exclusion); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for GetExclusion</summary> public void GetExclusion() { // Snippet: GetExclusion(ExclusionNameOneof,CallSettings) // Create client ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.Create(); // Initialize request argument(s) ExclusionNameOneof name = ExclusionNameOneof.From(new ExclusionName("[PROJECT]", "[EXCLUSION]")); // Make the request LogExclusion response = configServiceV2Client.GetExclusion(name); // End snippet }
/// <summary>Snippet for CreateExclusion</summary> public void CreateExclusion() { // Snippet: CreateExclusion(ParentNameOneof,LogExclusion,CallSettings) // Create client ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.Create(); // Initialize request argument(s) ParentNameOneof parent = ParentNameOneof.From(new ProjectName("[PROJECT]")); LogExclusion exclusion = new LogExclusion(); // Make the request LogExclusion response = configServiceV2Client.CreateExclusion(parent, exclusion); // End snippet }
/// <summary>Snippet for UpdateExclusion</summary> public void UpdateExclusion() { // Snippet: UpdateExclusion(ExclusionNameOneof,LogExclusion,FieldMask,CallSettings) // Create client ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.Create(); // Initialize request argument(s) ExclusionNameOneof name = ExclusionNameOneof.From(new ExclusionName("[PROJECT]", "[EXCLUSION]")); LogExclusion exclusion = new LogExclusion(); FieldMask updateMask = new FieldMask(); // Make the request LogExclusion response = configServiceV2Client.UpdateExclusion(name, exclusion, updateMask); // End snippet }
/// <summary>Snippet for GetExclusion</summary> public void GetExclusion_RequestObject() { // Snippet: GetExclusion(GetExclusionRequest,CallSettings) // Create client ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.Create(); // Initialize request argument(s) GetExclusionRequest request = new GetExclusionRequest { ExclusionNameOneof = ExclusionNameOneof.From(new ExclusionName("[PROJECT]", "[EXCLUSION]")), }; // Make the request LogExclusion response = configServiceV2Client.GetExclusion(request); // End snippet }
/// <summary>Snippet for GetExclusionAsync</summary> public async Task GetExclusionAsync() { // Snippet: GetExclusionAsync(ExclusionNameOneof,CallSettings) // Additional: GetExclusionAsync(ExclusionNameOneof,CancellationToken) // Create client ConfigServiceV2Client configServiceV2Client = await ConfigServiceV2Client.CreateAsync(); // Initialize request argument(s) ExclusionNameOneof name = ExclusionNameOneof.From(new ExclusionName("[PROJECT]", "[EXCLUSION]")); // Make the request LogExclusion response = await configServiceV2Client.GetExclusionAsync(name); // End snippet }
/// <summary>Snippet for CreateExclusion</summary> public void CreateExclusion_RequestObject() { // Snippet: CreateExclusion(CreateExclusionRequest,CallSettings) // Create client ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.Create(); // Initialize request argument(s) CreateExclusionRequest request = new CreateExclusionRequest { ParentAsParentNameOneof = ParentNameOneof.From(new ProjectName("[PROJECT]")), Exclusion = new LogExclusion(), }; // Make the request LogExclusion response = configServiceV2Client.CreateExclusion(request); // End snippet }
/// <summary>Snippet for CreateExclusionAsync</summary> public async Task CreateExclusionAsync() { // Snippet: CreateExclusionAsync(ParentNameOneof,LogExclusion,CallSettings) // Additional: CreateExclusionAsync(ParentNameOneof,LogExclusion,CancellationToken) // Create client ConfigServiceV2Client configServiceV2Client = await ConfigServiceV2Client.CreateAsync(); // Initialize request argument(s) ParentNameOneof parent = ParentNameOneof.From(new ProjectName("[PROJECT]")); LogExclusion exclusion = new LogExclusion(); // Make the request LogExclusion response = await configServiceV2Client.CreateExclusionAsync(parent, exclusion); // End snippet }
/// <summary>Snippet for UpdateExclusion</summary> public void UpdateExclusion_RequestObject() { // Snippet: UpdateExclusion(UpdateExclusionRequest,CallSettings) // Create client ConfigServiceV2Client configServiceV2Client = ConfigServiceV2Client.Create(); // Initialize request argument(s) UpdateExclusionRequest request = new UpdateExclusionRequest { ExclusionNameOneof = ExclusionNameOneof.From(new ExclusionName("[PROJECT]", "[EXCLUSION]")), Exclusion = new LogExclusion(), UpdateMask = new FieldMask(), }; // Make the request LogExclusion response = configServiceV2Client.UpdateExclusion(request); // End snippet }
/// <summary>Snippet for UpdateExclusionAsync</summary> public async Task UpdateExclusionAsync() { // Snippet: UpdateExclusionAsync(ExclusionNameOneof,LogExclusion,FieldMask,CallSettings) // Additional: UpdateExclusionAsync(ExclusionNameOneof,LogExclusion,FieldMask,CancellationToken) // Create client ConfigServiceV2Client configServiceV2Client = await ConfigServiceV2Client.CreateAsync(); // Initialize request argument(s) ExclusionNameOneof name = ExclusionNameOneof.From(new ExclusionName("[PROJECT]", "[EXCLUSION]")); LogExclusion exclusion = new LogExclusion(); FieldMask updateMask = new FieldMask(); // Make the request LogExclusion response = await configServiceV2Client.UpdateExclusionAsync(name, exclusion, updateMask); // End snippet }
/// <summary>Snippet for CreateExclusionAsync</summary> public async Task CreateExclusionAsync_RequestObject() { // Snippet: CreateExclusionAsync(CreateExclusionRequest,CallSettings) // Additional: CreateExclusionAsync(CreateExclusionRequest,CancellationToken) // Create client ConfigServiceV2Client configServiceV2Client = await ConfigServiceV2Client.CreateAsync(); // Initialize request argument(s) CreateExclusionRequest request = new CreateExclusionRequest { ParentAsParentNameOneof = ParentNameOneof.From(new ProjectName("[PROJECT]")), Exclusion = new LogExclusion(), }; // Make the request LogExclusion response = await configServiceV2Client.CreateExclusionAsync(request); // End snippet }
/// <summary>Snippet for UpdateExclusionAsync</summary> public async Task UpdateExclusionAsync_RequestObject() { // Snippet: UpdateExclusionAsync(UpdateExclusionRequest,CallSettings) // Additional: UpdateExclusionAsync(UpdateExclusionRequest,CancellationToken) // Create client ConfigServiceV2Client configServiceV2Client = await ConfigServiceV2Client.CreateAsync(); // Initialize request argument(s) UpdateExclusionRequest request = new UpdateExclusionRequest { ExclusionNameOneof = ExclusionNameOneof.From(new ExclusionName("[PROJECT]", "[EXCLUSION]")), Exclusion = new LogExclusion(), UpdateMask = new FieldMask(), }; // Make the request LogExclusion response = await configServiceV2Client.UpdateExclusionAsync(request); // End snippet }
public void CreateExclusion2() { Mock <ConfigServiceV2.ConfigServiceV2Client> mockGrpcClient = new Mock <ConfigServiceV2.ConfigServiceV2Client>(MockBehavior.Strict); CreateExclusionRequest request = new CreateExclusionRequest { ParentAsParentNameOneof = ParentNameOneof.From(new ProjectName("[PROJECT]")), Exclusion = new LogExclusion(), }; LogExclusion expectedResponse = new LogExclusion { Name = "name3373707", Description = "description-1724546052", Filter = "filter-1274492040", Disabled = true, }; mockGrpcClient.Setup(x => x.CreateExclusion(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); ConfigServiceV2Client client = new ConfigServiceV2ClientImpl(mockGrpcClient.Object, null); LogExclusion response = client.CreateExclusion(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }