Skip to content
Snippets Groups Projects
Commit 2f8cfbde authored by MakMukhi's avatar MakMukhi Committed by GitHub
Browse files

Post-review updates

parent 49ccfda5
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
tl;dr: [Example code](https://github.com/grpc/grpc/blob/master/test/cpp/end2end/mock_test.cc). tl;dr: [Example code](https://github.com/grpc/grpc/blob/master/test/cpp/end2end/mock_test.cc).
To unit-test client-side logic via the synchronous API, gRPC provides a mocked Stub that can be programmed upon and easily incorporated in the test code. To unit-test client-side logic via the synchronous API, gRPC provides a mocked Stub based on googletest(googlemock) that can be programmed upon and easily incorporated in the test code.
For instance, consider an EchoService like this: For instance, consider an EchoService like this:
...@@ -14,7 +14,7 @@ service EchoTestService { ...@@ -14,7 +14,7 @@ service EchoTestService {
} }
``` ```
The code generate would look something like this: The code generated would look something like this:
```c++ ```c++
class EchoTestService final { class EchoTestService final {
...@@ -75,7 +75,7 @@ grpc_proto_library( ...@@ -75,7 +75,7 @@ grpc_proto_library(
``` ```
By adding such a flag now a header file `echo_mock.h` containing the mocked stub will also be generated. By adding such a flag now a header file `echo_mock.grpc.pb.h` containing the mocked stub will also be generated.
This header file can then be included in test files along with a gmock dependency. This header file can then be included in test files along with a gmock dependency.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment