-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmock_test.go
1539 lines (1417 loc) · 45 KB
/
mock_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package dotsqlx
import (
"context"
"database/sql"
"github.com/jmoiron/sqlx"
"sync"
)
var (
lockPreparerxMockPreparex sync.RWMutex
)
// Ensure, that PreparerxMock does implement Preparerx.
// If this is not the case, regenerate this file with moq.
var _ Preparerx = &PreparerxMock{}
// PreparerxMock is a mock implementation of Preparerx.
//
// func TestSomethingThatUsesPreparerx(t *testing.T) {
//
// // make and configure a mocked Preparerx
// mockedPreparerx := &PreparerxMock{
// PreparexFunc: func(query string) (*sqlx.Stmt, error) {
// panic("mock out the Preparex method")
// },
// }
//
// // use mockedPreparerx in code that requires Preparerx
// // and then make assertions.
//
// }
type PreparerxMock struct {
// PreparexFunc mocks the Preparex method.
PreparexFunc func(query string) (*sqlx.Stmt, error)
// calls tracks calls to the methods.
calls struct {
// Preparex holds details about calls to the Preparex method.
Preparex []struct {
// Query is the query argument value.
Query string
}
}
}
// Preparex calls PreparexFunc.
func (mock *PreparerxMock) Preparex(query string) (*sqlx.Stmt, error) {
if mock.PreparexFunc == nil {
panic("PreparerxMock.PreparexFunc: method is nil but Preparerx.Preparex was just called")
}
callInfo := struct {
Query string
}{
Query: query,
}
lockPreparerxMockPreparex.Lock()
mock.calls.Preparex = append(mock.calls.Preparex, callInfo)
lockPreparerxMockPreparex.Unlock()
return mock.PreparexFunc(query)
}
// PreparexCalls gets all the calls that were made to Preparex.
// Check the length with:
// len(mockedPreparerx.PreparexCalls())
func (mock *PreparerxMock) PreparexCalls() []struct {
Query string
} {
var calls []struct {
Query string
}
lockPreparerxMockPreparex.RLock()
calls = mock.calls.Preparex
lockPreparerxMockPreparex.RUnlock()
return calls
}
var (
lockPreparerxContextMockPreparexContext sync.RWMutex
)
// Ensure, that PreparerxContextMock does implement PreparerxContext.
// If this is not the case, regenerate this file with moq.
var _ PreparerxContext = &PreparerxContextMock{}
// PreparerxContextMock is a mock implementation of PreparerxContext.
//
// func TestSomethingThatUsesPreparerxContext(t *testing.T) {
//
// // make and configure a mocked PreparerxContext
// mockedPreparerxContext := &PreparerxContextMock{
// PreparexContextFunc: func(ctx context.Context, query string) (*sqlx.Stmt, error) {
// panic("mock out the PreparexContext method")
// },
// }
//
// // use mockedPreparerxContext in code that requires PreparerxContext
// // and then make assertions.
//
// }
type PreparerxContextMock struct {
// PreparexContextFunc mocks the PreparexContext method.
PreparexContextFunc func(ctx context.Context, query string) (*sqlx.Stmt, error)
// calls tracks calls to the methods.
calls struct {
// PreparexContext holds details about calls to the PreparexContext method.
PreparexContext []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Query is the query argument value.
Query string
}
}
}
// PreparexContext calls PreparexContextFunc.
func (mock *PreparerxContextMock) PreparexContext(ctx context.Context, query string) (*sqlx.Stmt, error) {
if mock.PreparexContextFunc == nil {
panic("PreparerxContextMock.PreparexContextFunc: method is nil but PreparerxContext.PreparexContext was just called")
}
callInfo := struct {
Ctx context.Context
Query string
}{
Ctx: ctx,
Query: query,
}
lockPreparerxContextMockPreparexContext.Lock()
mock.calls.PreparexContext = append(mock.calls.PreparexContext, callInfo)
lockPreparerxContextMockPreparexContext.Unlock()
return mock.PreparexContextFunc(ctx, query)
}
// PreparexContextCalls gets all the calls that were made to PreparexContext.
// Check the length with:
// len(mockedPreparerxContext.PreparexContextCalls())
func (mock *PreparerxContextMock) PreparexContextCalls() []struct {
Ctx context.Context
Query string
} {
var calls []struct {
Ctx context.Context
Query string
}
lockPreparerxContextMockPreparexContext.RLock()
calls = mock.calls.PreparexContext
lockPreparerxContextMockPreparexContext.RUnlock()
return calls
}
var (
lockGetterMockGet sync.RWMutex
)
// Ensure, that GetterMock does implement Getter.
// If this is not the case, regenerate this file with moq.
var _ Getter = &GetterMock{}
// GetterMock is a mock implementation of Getter.
//
// func TestSomethingThatUsesGetter(t *testing.T) {
//
// // make and configure a mocked Getter
// mockedGetter := &GetterMock{
// GetFunc: func(dest interface{}, query string, args ...interface{}) error {
// panic("mock out the Get method")
// },
// }
//
// // use mockedGetter in code that requires Getter
// // and then make assertions.
//
// }
type GetterMock struct {
// GetFunc mocks the Get method.
GetFunc func(dest interface{}, query string, args ...interface{}) error
// calls tracks calls to the methods.
calls struct {
// Get holds details about calls to the Get method.
Get []struct {
// Dest is the dest argument value.
Dest interface{}
// Query is the query argument value.
Query string
// Args is the args argument value.
Args []interface{}
}
}
}
// Get calls GetFunc.
func (mock *GetterMock) Get(dest interface{}, query string, args ...interface{}) error {
if mock.GetFunc == nil {
panic("GetterMock.GetFunc: method is nil but Getter.Get was just called")
}
callInfo := struct {
Dest interface{}
Query string
Args []interface{}
}{
Dest: dest,
Query: query,
Args: args,
}
lockGetterMockGet.Lock()
mock.calls.Get = append(mock.calls.Get, callInfo)
lockGetterMockGet.Unlock()
return mock.GetFunc(dest, query, args...)
}
// GetCalls gets all the calls that were made to Get.
// Check the length with:
// len(mockedGetter.GetCalls())
func (mock *GetterMock) GetCalls() []struct {
Dest interface{}
Query string
Args []interface{}
} {
var calls []struct {
Dest interface{}
Query string
Args []interface{}
}
lockGetterMockGet.RLock()
calls = mock.calls.Get
lockGetterMockGet.RUnlock()
return calls
}
var (
lockGetterContextMockGetContext sync.RWMutex
)
// Ensure, that GetterContextMock does implement GetterContext.
// If this is not the case, regenerate this file with moq.
var _ GetterContext = &GetterContextMock{}
// GetterContextMock is a mock implementation of GetterContext.
//
// func TestSomethingThatUsesGetterContext(t *testing.T) {
//
// // make and configure a mocked GetterContext
// mockedGetterContext := &GetterContextMock{
// GetContextFunc: func(ctx context.Context, dest interface{}, query string, args ...interface{}) error {
// panic("mock out the GetContext method")
// },
// }
//
// // use mockedGetterContext in code that requires GetterContext
// // and then make assertions.
//
// }
type GetterContextMock struct {
// GetContextFunc mocks the GetContext method.
GetContextFunc func(ctx context.Context, dest interface{}, query string, args ...interface{}) error
// calls tracks calls to the methods.
calls struct {
// GetContext holds details about calls to the GetContext method.
GetContext []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Dest is the dest argument value.
Dest interface{}
// Query is the query argument value.
Query string
// Args is the args argument value.
Args []interface{}
}
}
}
// GetContext calls GetContextFunc.
func (mock *GetterContextMock) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error {
if mock.GetContextFunc == nil {
panic("GetterContextMock.GetContextFunc: method is nil but GetterContext.GetContext was just called")
}
callInfo := struct {
Ctx context.Context
Dest interface{}
Query string
Args []interface{}
}{
Ctx: ctx,
Dest: dest,
Query: query,
Args: args,
}
lockGetterContextMockGetContext.Lock()
mock.calls.GetContext = append(mock.calls.GetContext, callInfo)
lockGetterContextMockGetContext.Unlock()
return mock.GetContextFunc(ctx, dest, query, args...)
}
// GetContextCalls gets all the calls that were made to GetContext.
// Check the length with:
// len(mockedGetterContext.GetContextCalls())
func (mock *GetterContextMock) GetContextCalls() []struct {
Ctx context.Context
Dest interface{}
Query string
Args []interface{}
} {
var calls []struct {
Ctx context.Context
Dest interface{}
Query string
Args []interface{}
}
lockGetterContextMockGetContext.RLock()
calls = mock.calls.GetContext
lockGetterContextMockGetContext.RUnlock()
return calls
}
var (
lockSelecterMockSelect sync.RWMutex
)
// Ensure, that SelecterMock does implement Selecter.
// If this is not the case, regenerate this file with moq.
var _ Selecter = &SelecterMock{}
// SelecterMock is a mock implementation of Selecter.
//
// func TestSomethingThatUsesSelecter(t *testing.T) {
//
// // make and configure a mocked Selecter
// mockedSelecter := &SelecterMock{
// SelectFunc: func(dest interface{}, query string, args ...interface{}) error {
// panic("mock out the Select method")
// },
// }
//
// // use mockedSelecter in code that requires Selecter
// // and then make assertions.
//
// }
type SelecterMock struct {
// SelectFunc mocks the Select method.
SelectFunc func(dest interface{}, query string, args ...interface{}) error
// calls tracks calls to the methods.
calls struct {
// Select holds details about calls to the Select method.
Select []struct {
// Dest is the dest argument value.
Dest interface{}
// Query is the query argument value.
Query string
// Args is the args argument value.
Args []interface{}
}
}
}
// Select calls SelectFunc.
func (mock *SelecterMock) Select(dest interface{}, query string, args ...interface{}) error {
if mock.SelectFunc == nil {
panic("SelecterMock.SelectFunc: method is nil but Selecter.Select was just called")
}
callInfo := struct {
Dest interface{}
Query string
Args []interface{}
}{
Dest: dest,
Query: query,
Args: args,
}
lockSelecterMockSelect.Lock()
mock.calls.Select = append(mock.calls.Select, callInfo)
lockSelecterMockSelect.Unlock()
return mock.SelectFunc(dest, query, args...)
}
// SelectCalls gets all the calls that were made to Select.
// Check the length with:
// len(mockedSelecter.SelectCalls())
func (mock *SelecterMock) SelectCalls() []struct {
Dest interface{}
Query string
Args []interface{}
} {
var calls []struct {
Dest interface{}
Query string
Args []interface{}
}
lockSelecterMockSelect.RLock()
calls = mock.calls.Select
lockSelecterMockSelect.RUnlock()
return calls
}
var (
lockSelecterContextMockSelectContext sync.RWMutex
)
// Ensure, that SelecterContextMock does implement SelecterContext.
// If this is not the case, regenerate this file with moq.
var _ SelecterContext = &SelecterContextMock{}
// SelecterContextMock is a mock implementation of SelecterContext.
//
// func TestSomethingThatUsesSelecterContext(t *testing.T) {
//
// // make and configure a mocked SelecterContext
// mockedSelecterContext := &SelecterContextMock{
// SelectContextFunc: func(ctx context.Context, dest interface{}, query string, args ...interface{}) error {
// panic("mock out the SelectContext method")
// },
// }
//
// // use mockedSelecterContext in code that requires SelecterContext
// // and then make assertions.
//
// }
type SelecterContextMock struct {
// SelectContextFunc mocks the SelectContext method.
SelectContextFunc func(ctx context.Context, dest interface{}, query string, args ...interface{}) error
// calls tracks calls to the methods.
calls struct {
// SelectContext holds details about calls to the SelectContext method.
SelectContext []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Dest is the dest argument value.
Dest interface{}
// Query is the query argument value.
Query string
// Args is the args argument value.
Args []interface{}
}
}
}
// SelectContext calls SelectContextFunc.
func (mock *SelecterContextMock) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error {
if mock.SelectContextFunc == nil {
panic("SelecterContextMock.SelectContextFunc: method is nil but SelecterContext.SelectContext was just called")
}
callInfo := struct {
Ctx context.Context
Dest interface{}
Query string
Args []interface{}
}{
Ctx: ctx,
Dest: dest,
Query: query,
Args: args,
}
lockSelecterContextMockSelectContext.Lock()
mock.calls.SelectContext = append(mock.calls.SelectContext, callInfo)
lockSelecterContextMockSelectContext.Unlock()
return mock.SelectContextFunc(ctx, dest, query, args...)
}
// SelectContextCalls gets all the calls that were made to SelectContext.
// Check the length with:
// len(mockedSelecterContext.SelectContextCalls())
func (mock *SelecterContextMock) SelectContextCalls() []struct {
Ctx context.Context
Dest interface{}
Query string
Args []interface{}
} {
var calls []struct {
Ctx context.Context
Dest interface{}
Query string
Args []interface{}
}
lockSelecterContextMockSelectContext.RLock()
calls = mock.calls.SelectContext
lockSelecterContextMockSelectContext.RUnlock()
return calls
}
var (
lockQueryerxMockQueryx sync.RWMutex
)
// Ensure, that QueryerxMock does implement Queryerx.
// If this is not the case, regenerate this file with moq.
var _ Queryerx = &QueryerxMock{}
// QueryerxMock is a mock implementation of Queryerx.
//
// func TestSomethingThatUsesQueryerx(t *testing.T) {
//
// // make and configure a mocked Queryerx
// mockedQueryerx := &QueryerxMock{
// QueryxFunc: func(query string, args ...interface{}) (*sqlx.Rows, error) {
// panic("mock out the Queryx method")
// },
// }
//
// // use mockedQueryerx in code that requires Queryerx
// // and then make assertions.
//
// }
type QueryerxMock struct {
// QueryxFunc mocks the Queryx method.
QueryxFunc func(query string, args ...interface{}) (*sqlx.Rows, error)
// calls tracks calls to the methods.
calls struct {
// Queryx holds details about calls to the Queryx method.
Queryx []struct {
// Query is the query argument value.
Query string
// Args is the args argument value.
Args []interface{}
}
}
}
// Queryx calls QueryxFunc.
func (mock *QueryerxMock) Queryx(query string, args ...interface{}) (*sqlx.Rows, error) {
if mock.QueryxFunc == nil {
panic("QueryerxMock.QueryxFunc: method is nil but Queryerx.Queryx was just called")
}
callInfo := struct {
Query string
Args []interface{}
}{
Query: query,
Args: args,
}
lockQueryerxMockQueryx.Lock()
mock.calls.Queryx = append(mock.calls.Queryx, callInfo)
lockQueryerxMockQueryx.Unlock()
return mock.QueryxFunc(query, args...)
}
// QueryxCalls gets all the calls that were made to Queryx.
// Check the length with:
// len(mockedQueryerx.QueryxCalls())
func (mock *QueryerxMock) QueryxCalls() []struct {
Query string
Args []interface{}
} {
var calls []struct {
Query string
Args []interface{}
}
lockQueryerxMockQueryx.RLock()
calls = mock.calls.Queryx
lockQueryerxMockQueryx.RUnlock()
return calls
}
var (
lockQueryerxContextMockQueryxContext sync.RWMutex
)
// Ensure, that QueryerxContextMock does implement QueryerxContext.
// If this is not the case, regenerate this file with moq.
var _ QueryerxContext = &QueryerxContextMock{}
// QueryerxContextMock is a mock implementation of QueryerxContext.
//
// func TestSomethingThatUsesQueryerxContext(t *testing.T) {
//
// // make and configure a mocked QueryerxContext
// mockedQueryerxContext := &QueryerxContextMock{
// QueryxContextFunc: func(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error) {
// panic("mock out the QueryxContext method")
// },
// }
//
// // use mockedQueryerxContext in code that requires QueryerxContext
// // and then make assertions.
//
// }
type QueryerxContextMock struct {
// QueryxContextFunc mocks the QueryxContext method.
QueryxContextFunc func(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error)
// calls tracks calls to the methods.
calls struct {
// QueryxContext holds details about calls to the QueryxContext method.
QueryxContext []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Query is the query argument value.
Query string
// Args is the args argument value.
Args []interface{}
}
}
}
// QueryxContext calls QueryxContextFunc.
func (mock *QueryerxContextMock) QueryxContext(ctx context.Context, query string, args ...interface{}) (*sqlx.Rows, error) {
if mock.QueryxContextFunc == nil {
panic("QueryerxContextMock.QueryxContextFunc: method is nil but QueryerxContext.QueryxContext was just called")
}
callInfo := struct {
Ctx context.Context
Query string
Args []interface{}
}{
Ctx: ctx,
Query: query,
Args: args,
}
lockQueryerxContextMockQueryxContext.Lock()
mock.calls.QueryxContext = append(mock.calls.QueryxContext, callInfo)
lockQueryerxContextMockQueryxContext.Unlock()
return mock.QueryxContextFunc(ctx, query, args...)
}
// QueryxContextCalls gets all the calls that were made to QueryxContext.
// Check the length with:
// len(mockedQueryerxContext.QueryxContextCalls())
func (mock *QueryerxContextMock) QueryxContextCalls() []struct {
Ctx context.Context
Query string
Args []interface{}
} {
var calls []struct {
Ctx context.Context
Query string
Args []interface{}
}
lockQueryerxContextMockQueryxContext.RLock()
calls = mock.calls.QueryxContext
lockQueryerxContextMockQueryxContext.RUnlock()
return calls
}
var (
lockQueryRowerxMockQueryRowx sync.RWMutex
)
// Ensure, that QueryRowerxMock does implement QueryRowerx.
// If this is not the case, regenerate this file with moq.
var _ QueryRowerx = &QueryRowerxMock{}
// QueryRowerxMock is a mock implementation of QueryRowerx.
//
// func TestSomethingThatUsesQueryRowerx(t *testing.T) {
//
// // make and configure a mocked QueryRowerx
// mockedQueryRowerx := &QueryRowerxMock{
// QueryRowxFunc: func(query string, args ...interface{}) *sqlx.Row {
// panic("mock out the QueryRowx method")
// },
// }
//
// // use mockedQueryRowerx in code that requires QueryRowerx
// // and then make assertions.
//
// }
type QueryRowerxMock struct {
// QueryRowxFunc mocks the QueryRowx method.
QueryRowxFunc func(query string, args ...interface{}) *sqlx.Row
// calls tracks calls to the methods.
calls struct {
// QueryRowx holds details about calls to the QueryRowx method.
QueryRowx []struct {
// Query is the query argument value.
Query string
// Args is the args argument value.
Args []interface{}
}
}
}
// QueryRowx calls QueryRowxFunc.
func (mock *QueryRowerxMock) QueryRowx(query string, args ...interface{}) *sqlx.Row {
if mock.QueryRowxFunc == nil {
panic("QueryRowerxMock.QueryRowxFunc: method is nil but QueryRowerx.QueryRowx was just called")
}
callInfo := struct {
Query string
Args []interface{}
}{
Query: query,
Args: args,
}
lockQueryRowerxMockQueryRowx.Lock()
mock.calls.QueryRowx = append(mock.calls.QueryRowx, callInfo)
lockQueryRowerxMockQueryRowx.Unlock()
return mock.QueryRowxFunc(query, args...)
}
// QueryRowxCalls gets all the calls that were made to QueryRowx.
// Check the length with:
// len(mockedQueryRowerx.QueryRowxCalls())
func (mock *QueryRowerxMock) QueryRowxCalls() []struct {
Query string
Args []interface{}
} {
var calls []struct {
Query string
Args []interface{}
}
lockQueryRowerxMockQueryRowx.RLock()
calls = mock.calls.QueryRowx
lockQueryRowerxMockQueryRowx.RUnlock()
return calls
}
var (
lockQueryRowerxContextMockQueryRowxContext sync.RWMutex
)
// Ensure, that QueryRowerxContextMock does implement QueryRowerxContext.
// If this is not the case, regenerate this file with moq.
var _ QueryRowerxContext = &QueryRowerxContextMock{}
// QueryRowerxContextMock is a mock implementation of QueryRowerxContext.
//
// func TestSomethingThatUsesQueryRowerxContext(t *testing.T) {
//
// // make and configure a mocked QueryRowerxContext
// mockedQueryRowerxContext := &QueryRowerxContextMock{
// QueryRowxContextFunc: func(ctx context.Context, query string, args ...interface{}) *sqlx.Row {
// panic("mock out the QueryRowxContext method")
// },
// }
//
// // use mockedQueryRowerxContext in code that requires QueryRowerxContext
// // and then make assertions.
//
// }
type QueryRowerxContextMock struct {
// QueryRowxContextFunc mocks the QueryRowxContext method.
QueryRowxContextFunc func(ctx context.Context, query string, args ...interface{}) *sqlx.Row
// calls tracks calls to the methods.
calls struct {
// QueryRowxContext holds details about calls to the QueryRowxContext method.
QueryRowxContext []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Query is the query argument value.
Query string
// Args is the args argument value.
Args []interface{}
}
}
}
// QueryRowxContext calls QueryRowxContextFunc.
func (mock *QueryRowerxContextMock) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *sqlx.Row {
if mock.QueryRowxContextFunc == nil {
panic("QueryRowerxContextMock.QueryRowxContextFunc: method is nil but QueryRowerxContext.QueryRowxContext was just called")
}
callInfo := struct {
Ctx context.Context
Query string
Args []interface{}
}{
Ctx: ctx,
Query: query,
Args: args,
}
lockQueryRowerxContextMockQueryRowxContext.Lock()
mock.calls.QueryRowxContext = append(mock.calls.QueryRowxContext, callInfo)
lockQueryRowerxContextMockQueryRowxContext.Unlock()
return mock.QueryRowxContextFunc(ctx, query, args...)
}
// QueryRowxContextCalls gets all the calls that were made to QueryRowxContext.
// Check the length with:
// len(mockedQueryRowerxContext.QueryRowxContextCalls())
func (mock *QueryRowerxContextMock) QueryRowxContextCalls() []struct {
Ctx context.Context
Query string
Args []interface{}
} {
var calls []struct {
Ctx context.Context
Query string
Args []interface{}
}
lockQueryRowerxContextMockQueryRowxContext.RLock()
calls = mock.calls.QueryRowxContext
lockQueryRowerxContextMockQueryRowxContext.RUnlock()
return calls
}
var (
lockMustExecerMockMustExec sync.RWMutex
)
// Ensure, that MustExecerMock does implement MustExecer.
// If this is not the case, regenerate this file with moq.
var _ MustExecer = &MustExecerMock{}
// MustExecerMock is a mock implementation of MustExecer.
//
// func TestSomethingThatUsesMustExecer(t *testing.T) {
//
// // make and configure a mocked MustExecer
// mockedMustExecer := &MustExecerMock{
// MustExecFunc: func(query string, args ...interface{}) sql.Result {
// panic("mock out the MustExec method")
// },
// }
//
// // use mockedMustExecer in code that requires MustExecer
// // and then make assertions.
//
// }
type MustExecerMock struct {
// MustExecFunc mocks the MustExec method.
MustExecFunc func(query string, args ...interface{}) sql.Result
// calls tracks calls to the methods.
calls struct {
// MustExec holds details about calls to the MustExec method.
MustExec []struct {
// Query is the query argument value.
Query string
// Args is the args argument value.
Args []interface{}
}
}
}
// MustExec calls MustExecFunc.
func (mock *MustExecerMock) MustExec(query string, args ...interface{}) sql.Result {
if mock.MustExecFunc == nil {
panic("MustExecerMock.MustExecFunc: method is nil but MustExecer.MustExec was just called")
}
callInfo := struct {
Query string
Args []interface{}
}{
Query: query,
Args: args,
}
lockMustExecerMockMustExec.Lock()
mock.calls.MustExec = append(mock.calls.MustExec, callInfo)
lockMustExecerMockMustExec.Unlock()
return mock.MustExecFunc(query, args...)
}
// MustExecCalls gets all the calls that were made to MustExec.
// Check the length with:
// len(mockedMustExecer.MustExecCalls())
func (mock *MustExecerMock) MustExecCalls() []struct {
Query string
Args []interface{}
} {
var calls []struct {
Query string
Args []interface{}
}
lockMustExecerMockMustExec.RLock()
calls = mock.calls.MustExec
lockMustExecerMockMustExec.RUnlock()
return calls
}
var (
lockMustExecerContextMockMustExecContext sync.RWMutex
)
// Ensure, that MustExecerContextMock does implement MustExecerContext.
// If this is not the case, regenerate this file with moq.
var _ MustExecerContext = &MustExecerContextMock{}
// MustExecerContextMock is a mock implementation of MustExecerContext.
//
// func TestSomethingThatUsesMustExecerContext(t *testing.T) {
//
// // make and configure a mocked MustExecerContext
// mockedMustExecerContext := &MustExecerContextMock{
// MustExecContextFunc: func(ctx context.Context, query string, args ...interface{}) sql.Result {
// panic("mock out the MustExecContext method")
// },
// }
//
// // use mockedMustExecerContext in code that requires MustExecerContext
// // and then make assertions.
//
// }
type MustExecerContextMock struct {
// MustExecContextFunc mocks the MustExecContext method.
MustExecContextFunc func(ctx context.Context, query string, args ...interface{}) sql.Result
// calls tracks calls to the methods.
calls struct {
// MustExecContext holds details about calls to the MustExecContext method.
MustExecContext []struct {
// Ctx is the ctx argument value.
Ctx context.Context
// Query is the query argument value.
Query string
// Args is the args argument value.
Args []interface{}
}
}
}
// MustExecContext calls MustExecContextFunc.
func (mock *MustExecerContextMock) MustExecContext(ctx context.Context, query string, args ...interface{}) sql.Result {
if mock.MustExecContextFunc == nil {
panic("MustExecerContextMock.MustExecContextFunc: method is nil but MustExecerContext.MustExecContext was just called")
}
callInfo := struct {
Ctx context.Context
Query string
Args []interface{}
}{
Ctx: ctx,
Query: query,
Args: args,
}
lockMustExecerContextMockMustExecContext.Lock()
mock.calls.MustExecContext = append(mock.calls.MustExecContext, callInfo)
lockMustExecerContextMockMustExecContext.Unlock()
return mock.MustExecContextFunc(ctx, query, args...)
}
// MustExecContextCalls gets all the calls that were made to MustExecContext.
// Check the length with:
// len(mockedMustExecerContext.MustExecContextCalls())
func (mock *MustExecerContextMock) MustExecContextCalls() []struct {
Ctx context.Context
Query string
Args []interface{}
} {
var calls []struct {
Ctx context.Context
Query string
Args []interface{}
}
lockMustExecerContextMockMustExecContext.RLock()
calls = mock.calls.MustExecContext
lockMustExecerContextMockMustExecContext.RUnlock()
return calls
}
var (
lockRebinderMockRebind sync.RWMutex
)
// Ensure, that RebinderMock does implement Rebinder.
// If this is not the case, regenerate this file with moq.
var _ Rebinder = &RebinderMock{}
// RebinderMock is a mock implementation of Rebinder.
//
// func TestSomethingThatUsesRebinder(t *testing.T) {
//
// // make and configure a mocked Rebinder
// mockedRebinder := &RebinderMock{
// RebindFunc: func(query string) string {
// panic("mock out the Rebind method")
// },
// }
//
// // use mockedRebinder in code that requires Rebinder
// // and then make assertions.
//
// }
type RebinderMock struct {
// RebindFunc mocks the Rebind method.
RebindFunc func(query string) string
// calls tracks calls to the methods.
calls struct {
// Rebind holds details about calls to the Rebind method.
Rebind []struct {
// Query is the query argument value.
Query string
}
}
}
// Rebind calls RebindFunc.
func (mock *RebinderMock) Rebind(query string) string {
if mock.RebindFunc == nil {
panic("RebinderMock.RebindFunc: method is nil but Rebinder.Rebind was just called")
}
callInfo := struct {
Query string
}{
Query: query,
}
lockRebinderMockRebind.Lock()
mock.calls.Rebind = append(mock.calls.Rebind, callInfo)
lockRebinderMockRebind.Unlock()
return mock.RebindFunc(query)
}