public async stt::Task DeleteGroupResourceNames2Async()
        {
            moq::Mock <GroupService.GroupServiceClient> mockGrpcClient = new moq::Mock <GroupService.GroupServiceClient>(moq::MockBehavior.Strict);
            DeleteGroupRequest request = new DeleteGroupRequest
            {
                GroupName = GroupName.FromProjectGroup("[PROJECT]", "[GROUP]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteGroupAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            GroupServiceClient client = new GroupServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteGroupAsync(request.ResourceName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            await client.DeleteGroupAsync(request.ResourceName, st::CancellationToken.None);

            mockGrpcClient.VerifyAll();
        }
Пример #2
0
        public async Task DeleteGroupAsync2()
        {
            Mock <GroupService.GroupServiceClient> mockGrpcClient = new Mock <GroupService.GroupServiceClient>(MockBehavior.Strict);
            DeleteGroupRequest request = new DeleteGroupRequest
            {
                GroupName = new GroupName("[PROJECT]", "[GROUP]"),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteGroupAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <Empty>(Task.FromResult(expectedResponse), null, null, null, null));
            GroupServiceClient client = new GroupServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteGroupAsync(request);

            mockGrpcClient.VerifyAll();
        }