mockgen/internal/tests/unexported_method/bugreport_test.go
raw| 1 | package bugreport |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/golang/mock/gomock" |
| 7 | ) |
| 8 | |
| 9 | func TestCallExample(t *testing.T) { |
| 10 | ctrl := gomock.NewController(t) |
| 11 | defer ctrl.Finish() |
| 12 | |
| 13 | e := NewMockExample(ctrl) |
| 14 | e.EXPECT().someMethod(gomock.Any()).Return("it works!") |
| 15 | |
| 16 | CallExample(e) |
| 17 | } |