public async Task BatchCreateNotesAsync2() { Mock <Grafeas.GrafeasClient> mockGrpcClient = new Mock <Grafeas.GrafeasClient>(MockBehavior.Strict); BatchCreateNotesRequest request = new BatchCreateNotesRequest { ParentAsProjectName = new ProjectName("[PROJECT]"), Notes = { }, }; BatchCreateNotesResponse expectedResponse = new BatchCreateNotesResponse(); mockGrpcClient.Setup(x => x.BatchCreateNotesAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <BatchCreateNotesResponse>(Task.FromResult(expectedResponse), null, null, null, null)); GrafeasClient client = new GrafeasClientImpl(mockGrpcClient.Object, null); BatchCreateNotesResponse response = await client.BatchCreateNotesAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void BatchCreateNotes2() { Mock <Grafeas.GrafeasClient> mockGrpcClient = new Mock <Grafeas.GrafeasClient>(MockBehavior.Strict); BatchCreateNotesRequest request = new BatchCreateNotesRequest { ParentAsProjectName = new ProjectName("[PROJECT]"), Notes = { }, }; BatchCreateNotesResponse expectedResponse = new BatchCreateNotesResponse(); mockGrpcClient.Setup(x => x.BatchCreateNotes(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); GrafeasClient client = new GrafeasClientImpl(mockGrpcClient.Object, null); BatchCreateNotesResponse response = client.BatchCreateNotes(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }