Skip to content

Commit ecc27db

Browse files
committed
example with mock template class
1 parent 5c11ed8 commit ecc27db

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ file_template_cpp = ""
124124
#include <gmock/gmock.h>
125125
#include "I2.hpp"
126126

127-
namespace n1 {
127+
namespace n {
128128

129129
class I2Mock : public I2
130130
{
@@ -145,9 +145,35 @@ public:
145145
MOCK_METHOD0(function_call_or_cast_operator, int());
146146
};
147147

148-
} // namespace n1
148+
} // namespace n
149149

150150
#endif // I2MOCK_HPP
151151

152152
```
153153

154+
```
155+
/*
156+
* file generated by gmock: TMock.hpp
157+
*/
158+
#ifndef TMOCK_HPP
159+
#define TMOCK_HPP
160+
161+
#include <gmock/gmock.h>
162+
#include "./given/T.hpp"
163+
164+
namespace n {
165+
166+
template<typename Elem>
167+
class TMock : public T<Elem>
168+
{
169+
public:
170+
MOCK_CONST_METHOD0_T(GetSize, int());
171+
MOCK_METHOD1_T(Push, void(const Elem &));
172+
};
173+
174+
} // namespace n
175+
176+
#endif // TMOCK_HPP
177+
```
178+
179+

0 commit comments

Comments
 (0)