public void DeleteTenantResourceNames() { moq::Mock <TenantService.TenantServiceClient> mockGrpcClient = new moq::Mock <TenantService.TenantServiceClient>(moq::MockBehavior.Strict); DeleteTenantRequest request = new DeleteTenantRequest { TenantName = TenantName.FromProjectTenant("[PROJECT]", "[TENANT]"), }; wkt::Empty expectedResponse = new wkt::Empty { }; mockGrpcClient.Setup(x => x.DeleteTenant(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); TenantServiceClient client = new TenantServiceClientImpl(mockGrpcClient.Object, null); client.DeleteTenant(request.TenantName); mockGrpcClient.VerifyAll(); }
public void DeleteTenant2() { Mock <TenantService.TenantServiceClient> mockGrpcClient = new Mock <TenantService.TenantServiceClient>(MockBehavior.Strict); DeleteTenantRequest request = new DeleteTenantRequest { TenantName = new TenantName("[PROJECT]", "[TENANT]"), }; Empty expectedResponse = new Empty(); mockGrpcClient.Setup(x => x.DeleteTenant(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); TenantServiceClient client = new TenantServiceClientImpl(mockGrpcClient.Object, null); client.DeleteTenant(request); mockGrpcClient.VerifyAll(); }