public void ReportPhishing() { moq::Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client> mockGrpcClient = new moq::Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client>(moq::MockBehavior.Strict); ReportPhishingRequest request = new ReportPhishingRequest { ParentAsProjectName = gagr::ProjectName.FromProject("[PROJECT]"), Uri = "uri3db70593", }; ReportPhishingResponse expectedResponse = new ReportPhishingResponse { }; mockGrpcClient.Setup(x => x.ReportPhishing(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); PhishingProtectionServiceV1Beta1Client client = new PhishingProtectionServiceV1Beta1ClientImpl(mockGrpcClient.Object, null); ReportPhishingResponse response = client.ReportPhishing(request.Parent, request.Uri); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void ReportPhishing2() { Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client> mockGrpcClient = new Mock <PhishingProtectionServiceV1Beta1.PhishingProtectionServiceV1Beta1Client>(MockBehavior.Strict); ReportPhishingRequest request = new ReportPhishingRequest { ParentAsProjectName = new ProjectName("[PROJECT]"), Uri = "uri116076", }; ReportPhishingResponse expectedResponse = new ReportPhishingResponse(); mockGrpcClient.Setup(x => x.ReportPhishing(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); PhishingProtectionServiceV1Beta1Client client = new PhishingProtectionServiceV1Beta1ClientImpl(mockGrpcClient.Object, null); ReportPhishingResponse response = client.ReportPhishing(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }