-
Notifications
You must be signed in to change notification settings - Fork 2
/
data_signer_mock.go
1505 lines (1237 loc) · 56.2 KB
/
data_signer_mock.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
package cryptkit
// Code generated by http://github.com/gojuno/minimock (dev). DO NOT EDIT.
import (
"io"
"sync"
mm_atomic "sync/atomic"
mm_time "time"
"github.com/gojuno/minimock/v3"
)
// DataSignerMock implements DataSigner
type DataSignerMock struct {
t minimock.Tester
funcDigestBytes func(ba1 []byte) (d1 Digest)
inspectFuncDigestBytes func(ba1 []byte)
afterDigestBytesCounter uint64
beforeDigestBytesCounter uint64
DigestBytesMock mDataSignerMockDigestBytes
funcDigestData func(r1 io.Reader) (d1 Digest)
inspectFuncDigestData func(r1 io.Reader)
afterDigestDataCounter uint64
beforeDigestDataCounter uint64
DigestDataMock mDataSignerMockDigestData
funcGetDigestMethod func() (d1 DigestMethod)
inspectFuncGetDigestMethod func()
afterGetDigestMethodCounter uint64
beforeGetDigestMethodCounter uint64
GetDigestMethodMock mDataSignerMockGetDigestMethod
funcGetDigestSize func() (i1 int)
inspectFuncGetDigestSize func()
afterGetDigestSizeCounter uint64
beforeGetDigestSizeCounter uint64
GetDigestSizeMock mDataSignerMockGetDigestSize
funcGetSignatureMethod func() (s1 SignatureMethod)
inspectFuncGetSignatureMethod func()
afterGetSignatureMethodCounter uint64
beforeGetSignatureMethodCounter uint64
GetSignatureMethodMock mDataSignerMockGetSignatureMethod
funcGetSigningMethod func() (s1 SigningMethod)
inspectFuncGetSigningMethod func()
afterGetSigningMethodCounter uint64
beforeGetSigningMethodCounter uint64
GetSigningMethodMock mDataSignerMockGetSigningMethod
funcNewHasher func() (d1 DigestHasher)
inspectFuncNewHasher func()
afterNewHasherCounter uint64
beforeNewHasherCounter uint64
NewHasherMock mDataSignerMockNewHasher
funcSignDigest func(digest Digest) (s1 Signature)
inspectFuncSignDigest func(digest Digest)
afterSignDigestCounter uint64
beforeSignDigestCounter uint64
SignDigestMock mDataSignerMockSignDigest
}
// NewDataSignerMock returns a mock for DataSigner
func NewDataSignerMock(t minimock.Tester) *DataSignerMock {
m := &DataSignerMock{t: t}
if controller, ok := t.(minimock.MockController); ok {
controller.RegisterMocker(m)
}
m.DigestBytesMock = mDataSignerMockDigestBytes{mock: m}
m.DigestBytesMock.callArgs = []*DataSignerMockDigestBytesParams{}
m.DigestDataMock = mDataSignerMockDigestData{mock: m}
m.DigestDataMock.callArgs = []*DataSignerMockDigestDataParams{}
m.GetDigestMethodMock = mDataSignerMockGetDigestMethod{mock: m}
m.GetDigestSizeMock = mDataSignerMockGetDigestSize{mock: m}
m.GetSignatureMethodMock = mDataSignerMockGetSignatureMethod{mock: m}
m.GetSigningMethodMock = mDataSignerMockGetSigningMethod{mock: m}
m.NewHasherMock = mDataSignerMockNewHasher{mock: m}
m.SignDigestMock = mDataSignerMockSignDigest{mock: m}
m.SignDigestMock.callArgs = []*DataSignerMockSignDigestParams{}
return m
}
type mDataSignerMockDigestBytes struct {
mock *DataSignerMock
defaultExpectation *DataSignerMockDigestBytesExpectation
expectations []*DataSignerMockDigestBytesExpectation
callArgs []*DataSignerMockDigestBytesParams
mutex sync.RWMutex
}
// DataSignerMockDigestBytesExpectation specifies expectation struct of the DataSigner.DigestBytes
type DataSignerMockDigestBytesExpectation struct {
mock *DataSignerMock
params *DataSignerMockDigestBytesParams
results *DataSignerMockDigestBytesResults
Counter uint64
}
// DataSignerMockDigestBytesParams contains parameters of the DataSigner.DigestBytes
type DataSignerMockDigestBytesParams struct {
ba1 []byte
}
// DataSignerMockDigestBytesResults contains results of the DataSigner.DigestBytes
type DataSignerMockDigestBytesResults struct {
d1 Digest
}
// Expect sets up expected params for DataSigner.DigestBytes
func (mmDigestBytes *mDataSignerMockDigestBytes) Expect(ba1 []byte) *mDataSignerMockDigestBytes {
if mmDigestBytes.mock.funcDigestBytes != nil {
mmDigestBytes.mock.t.Fatalf("DataSignerMock.DigestBytes mock is already set by Set")
}
if mmDigestBytes.defaultExpectation == nil {
mmDigestBytes.defaultExpectation = &DataSignerMockDigestBytesExpectation{}
}
mmDigestBytes.defaultExpectation.params = &DataSignerMockDigestBytesParams{ba1}
for _, e := range mmDigestBytes.expectations {
if minimock.Equal(e.params, mmDigestBytes.defaultExpectation.params) {
mmDigestBytes.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDigestBytes.defaultExpectation.params)
}
}
return mmDigestBytes
}
// Inspect accepts an inspector function that has same arguments as the DataSigner.DigestBytes
func (mmDigestBytes *mDataSignerMockDigestBytes) Inspect(f func(ba1 []byte)) *mDataSignerMockDigestBytes {
if mmDigestBytes.mock.inspectFuncDigestBytes != nil {
mmDigestBytes.mock.t.Fatalf("Inspect function is already set for DataSignerMock.DigestBytes")
}
mmDigestBytes.mock.inspectFuncDigestBytes = f
return mmDigestBytes
}
// Return sets up results that will be returned by DataSigner.DigestBytes
func (mmDigestBytes *mDataSignerMockDigestBytes) Return(d1 Digest) *DataSignerMock {
if mmDigestBytes.mock.funcDigestBytes != nil {
mmDigestBytes.mock.t.Fatalf("DataSignerMock.DigestBytes mock is already set by Set")
}
if mmDigestBytes.defaultExpectation == nil {
mmDigestBytes.defaultExpectation = &DataSignerMockDigestBytesExpectation{mock: mmDigestBytes.mock}
}
mmDigestBytes.defaultExpectation.results = &DataSignerMockDigestBytesResults{d1}
return mmDigestBytes.mock
}
//Set uses given function f to mock the DataSigner.DigestBytes method
func (mmDigestBytes *mDataSignerMockDigestBytes) Set(f func(ba1 []byte) (d1 Digest)) *DataSignerMock {
if mmDigestBytes.defaultExpectation != nil {
mmDigestBytes.mock.t.Fatalf("Default expectation is already set for the DataSigner.DigestBytes method")
}
if len(mmDigestBytes.expectations) > 0 {
mmDigestBytes.mock.t.Fatalf("Some expectations are already set for the DataSigner.DigestBytes method")
}
mmDigestBytes.mock.funcDigestBytes = f
return mmDigestBytes.mock
}
// When sets expectation for the DataSigner.DigestBytes which will trigger the result defined by the following
// Then helper
func (mmDigestBytes *mDataSignerMockDigestBytes) When(ba1 []byte) *DataSignerMockDigestBytesExpectation {
if mmDigestBytes.mock.funcDigestBytes != nil {
mmDigestBytes.mock.t.Fatalf("DataSignerMock.DigestBytes mock is already set by Set")
}
expectation := &DataSignerMockDigestBytesExpectation{
mock: mmDigestBytes.mock,
params: &DataSignerMockDigestBytesParams{ba1},
}
mmDigestBytes.expectations = append(mmDigestBytes.expectations, expectation)
return expectation
}
// Then sets up DataSigner.DigestBytes return parameters for the expectation previously defined by the When method
func (e *DataSignerMockDigestBytesExpectation) Then(d1 Digest) *DataSignerMock {
e.results = &DataSignerMockDigestBytesResults{d1}
return e.mock
}
// DigestBytes implements DataSigner
func (mmDigestBytes *DataSignerMock) DigestBytes(ba1 []byte) (d1 Digest) {
mm_atomic.AddUint64(&mmDigestBytes.beforeDigestBytesCounter, 1)
defer mm_atomic.AddUint64(&mmDigestBytes.afterDigestBytesCounter, 1)
if mmDigestBytes.inspectFuncDigestBytes != nil {
mmDigestBytes.inspectFuncDigestBytes(ba1)
}
mm_params := &DataSignerMockDigestBytesParams{ba1}
// Record call args
mmDigestBytes.DigestBytesMock.mutex.Lock()
mmDigestBytes.DigestBytesMock.callArgs = append(mmDigestBytes.DigestBytesMock.callArgs, mm_params)
mmDigestBytes.DigestBytesMock.mutex.Unlock()
for _, e := range mmDigestBytes.DigestBytesMock.expectations {
if minimock.Equal(e.params, mm_params) {
mm_atomic.AddUint64(&e.Counter, 1)
return e.results.d1
}
}
if mmDigestBytes.DigestBytesMock.defaultExpectation != nil {
mm_atomic.AddUint64(&mmDigestBytes.DigestBytesMock.defaultExpectation.Counter, 1)
mm_want := mmDigestBytes.DigestBytesMock.defaultExpectation.params
mm_got := DataSignerMockDigestBytesParams{ba1}
if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
mmDigestBytes.t.Errorf("DataSignerMock.DigestBytes got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
}
mm_results := mmDigestBytes.DigestBytesMock.defaultExpectation.results
if mm_results == nil {
mmDigestBytes.t.Fatal("No results are set for the DataSignerMock.DigestBytes")
}
return (*mm_results).d1
}
if mmDigestBytes.funcDigestBytes != nil {
return mmDigestBytes.funcDigestBytes(ba1)
}
mmDigestBytes.t.Fatalf("Unexpected call to DataSignerMock.DigestBytes. %v", ba1)
return
}
// DigestBytesAfterCounter returns a count of finished DataSignerMock.DigestBytes invocations
func (mmDigestBytes *DataSignerMock) DigestBytesAfterCounter() uint64 {
return mm_atomic.LoadUint64(&mmDigestBytes.afterDigestBytesCounter)
}
// DigestBytesBeforeCounter returns a count of DataSignerMock.DigestBytes invocations
func (mmDigestBytes *DataSignerMock) DigestBytesBeforeCounter() uint64 {
return mm_atomic.LoadUint64(&mmDigestBytes.beforeDigestBytesCounter)
}
// Calls returns a list of arguments used in each call to DataSignerMock.DigestBytes.
// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
func (mmDigestBytes *mDataSignerMockDigestBytes) Calls() []*DataSignerMockDigestBytesParams {
mmDigestBytes.mutex.RLock()
argCopy := make([]*DataSignerMockDigestBytesParams, len(mmDigestBytes.callArgs))
copy(argCopy, mmDigestBytes.callArgs)
mmDigestBytes.mutex.RUnlock()
return argCopy
}
// MinimockDigestBytesDone returns true if the count of the DigestBytes invocations corresponds
// the number of defined expectations
func (m *DataSignerMock) MinimockDigestBytesDone() bool {
for _, e := range m.DigestBytesMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
return false
}
}
// if default expectation was set then invocations count should be greater than zero
if m.DigestBytesMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDigestBytesCounter) < 1 {
return false
}
// if func was set then invocations count should be greater than zero
if m.funcDigestBytes != nil && mm_atomic.LoadUint64(&m.afterDigestBytesCounter) < 1 {
return false
}
return true
}
// MinimockDigestBytesInspect logs each unmet expectation
func (m *DataSignerMock) MinimockDigestBytesInspect() {
for _, e := range m.DigestBytesMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
m.t.Errorf("Expected call to DataSignerMock.DigestBytes with params: %#v", *e.params)
}
}
// if default expectation was set then invocations count should be greater than zero
if m.DigestBytesMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDigestBytesCounter) < 1 {
if m.DigestBytesMock.defaultExpectation.params == nil {
m.t.Error("Expected call to DataSignerMock.DigestBytes")
} else {
m.t.Errorf("Expected call to DataSignerMock.DigestBytes with params: %#v", *m.DigestBytesMock.defaultExpectation.params)
}
}
// if func was set then invocations count should be greater than zero
if m.funcDigestBytes != nil && mm_atomic.LoadUint64(&m.afterDigestBytesCounter) < 1 {
m.t.Error("Expected call to DataSignerMock.DigestBytes")
}
}
type mDataSignerMockDigestData struct {
mock *DataSignerMock
defaultExpectation *DataSignerMockDigestDataExpectation
expectations []*DataSignerMockDigestDataExpectation
callArgs []*DataSignerMockDigestDataParams
mutex sync.RWMutex
}
// DataSignerMockDigestDataExpectation specifies expectation struct of the DataSigner.DigestData
type DataSignerMockDigestDataExpectation struct {
mock *DataSignerMock
params *DataSignerMockDigestDataParams
results *DataSignerMockDigestDataResults
Counter uint64
}
// DataSignerMockDigestDataParams contains parameters of the DataSigner.DigestData
type DataSignerMockDigestDataParams struct {
r1 io.Reader
}
// DataSignerMockDigestDataResults contains results of the DataSigner.DigestData
type DataSignerMockDigestDataResults struct {
d1 Digest
}
// Expect sets up expected params for DataSigner.DigestData
func (mmDigestData *mDataSignerMockDigestData) Expect(r1 io.Reader) *mDataSignerMockDigestData {
if mmDigestData.mock.funcDigestData != nil {
mmDigestData.mock.t.Fatalf("DataSignerMock.DigestData mock is already set by Set")
}
if mmDigestData.defaultExpectation == nil {
mmDigestData.defaultExpectation = &DataSignerMockDigestDataExpectation{}
}
mmDigestData.defaultExpectation.params = &DataSignerMockDigestDataParams{r1}
for _, e := range mmDigestData.expectations {
if minimock.Equal(e.params, mmDigestData.defaultExpectation.params) {
mmDigestData.mock.t.Fatalf("Expectation set by When has same params: %#v", *mmDigestData.defaultExpectation.params)
}
}
return mmDigestData
}
// Inspect accepts an inspector function that has same arguments as the DataSigner.DigestData
func (mmDigestData *mDataSignerMockDigestData) Inspect(f func(r1 io.Reader)) *mDataSignerMockDigestData {
if mmDigestData.mock.inspectFuncDigestData != nil {
mmDigestData.mock.t.Fatalf("Inspect function is already set for DataSignerMock.DigestData")
}
mmDigestData.mock.inspectFuncDigestData = f
return mmDigestData
}
// Return sets up results that will be returned by DataSigner.DigestData
func (mmDigestData *mDataSignerMockDigestData) Return(d1 Digest) *DataSignerMock {
if mmDigestData.mock.funcDigestData != nil {
mmDigestData.mock.t.Fatalf("DataSignerMock.DigestData mock is already set by Set")
}
if mmDigestData.defaultExpectation == nil {
mmDigestData.defaultExpectation = &DataSignerMockDigestDataExpectation{mock: mmDigestData.mock}
}
mmDigestData.defaultExpectation.results = &DataSignerMockDigestDataResults{d1}
return mmDigestData.mock
}
//Set uses given function f to mock the DataSigner.DigestData method
func (mmDigestData *mDataSignerMockDigestData) Set(f func(r1 io.Reader) (d1 Digest)) *DataSignerMock {
if mmDigestData.defaultExpectation != nil {
mmDigestData.mock.t.Fatalf("Default expectation is already set for the DataSigner.DigestData method")
}
if len(mmDigestData.expectations) > 0 {
mmDigestData.mock.t.Fatalf("Some expectations are already set for the DataSigner.DigestData method")
}
mmDigestData.mock.funcDigestData = f
return mmDigestData.mock
}
// When sets expectation for the DataSigner.DigestData which will trigger the result defined by the following
// Then helper
func (mmDigestData *mDataSignerMockDigestData) When(r1 io.Reader) *DataSignerMockDigestDataExpectation {
if mmDigestData.mock.funcDigestData != nil {
mmDigestData.mock.t.Fatalf("DataSignerMock.DigestData mock is already set by Set")
}
expectation := &DataSignerMockDigestDataExpectation{
mock: mmDigestData.mock,
params: &DataSignerMockDigestDataParams{r1},
}
mmDigestData.expectations = append(mmDigestData.expectations, expectation)
return expectation
}
// Then sets up DataSigner.DigestData return parameters for the expectation previously defined by the When method
func (e *DataSignerMockDigestDataExpectation) Then(d1 Digest) *DataSignerMock {
e.results = &DataSignerMockDigestDataResults{d1}
return e.mock
}
// DigestData implements DataSigner
func (mmDigestData *DataSignerMock) DigestData(r1 io.Reader) (d1 Digest) {
mm_atomic.AddUint64(&mmDigestData.beforeDigestDataCounter, 1)
defer mm_atomic.AddUint64(&mmDigestData.afterDigestDataCounter, 1)
if mmDigestData.inspectFuncDigestData != nil {
mmDigestData.inspectFuncDigestData(r1)
}
mm_params := &DataSignerMockDigestDataParams{r1}
// Record call args
mmDigestData.DigestDataMock.mutex.Lock()
mmDigestData.DigestDataMock.callArgs = append(mmDigestData.DigestDataMock.callArgs, mm_params)
mmDigestData.DigestDataMock.mutex.Unlock()
for _, e := range mmDigestData.DigestDataMock.expectations {
if minimock.Equal(e.params, mm_params) {
mm_atomic.AddUint64(&e.Counter, 1)
return e.results.d1
}
}
if mmDigestData.DigestDataMock.defaultExpectation != nil {
mm_atomic.AddUint64(&mmDigestData.DigestDataMock.defaultExpectation.Counter, 1)
mm_want := mmDigestData.DigestDataMock.defaultExpectation.params
mm_got := DataSignerMockDigestDataParams{r1}
if mm_want != nil && !minimock.Equal(*mm_want, mm_got) {
mmDigestData.t.Errorf("DataSignerMock.DigestData got unexpected parameters, want: %#v, got: %#v%s\n", *mm_want, mm_got, minimock.Diff(*mm_want, mm_got))
}
mm_results := mmDigestData.DigestDataMock.defaultExpectation.results
if mm_results == nil {
mmDigestData.t.Fatal("No results are set for the DataSignerMock.DigestData")
}
return (*mm_results).d1
}
if mmDigestData.funcDigestData != nil {
return mmDigestData.funcDigestData(r1)
}
mmDigestData.t.Fatalf("Unexpected call to DataSignerMock.DigestData. %v", r1)
return
}
// DigestDataAfterCounter returns a count of finished DataSignerMock.DigestData invocations
func (mmDigestData *DataSignerMock) DigestDataAfterCounter() uint64 {
return mm_atomic.LoadUint64(&mmDigestData.afterDigestDataCounter)
}
// DigestDataBeforeCounter returns a count of DataSignerMock.DigestData invocations
func (mmDigestData *DataSignerMock) DigestDataBeforeCounter() uint64 {
return mm_atomic.LoadUint64(&mmDigestData.beforeDigestDataCounter)
}
// Calls returns a list of arguments used in each call to DataSignerMock.DigestData.
// The list is in the same order as the calls were made (i.e. recent calls have a higher index)
func (mmDigestData *mDataSignerMockDigestData) Calls() []*DataSignerMockDigestDataParams {
mmDigestData.mutex.RLock()
argCopy := make([]*DataSignerMockDigestDataParams, len(mmDigestData.callArgs))
copy(argCopy, mmDigestData.callArgs)
mmDigestData.mutex.RUnlock()
return argCopy
}
// MinimockDigestDataDone returns true if the count of the DigestData invocations corresponds
// the number of defined expectations
func (m *DataSignerMock) MinimockDigestDataDone() bool {
for _, e := range m.DigestDataMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
return false
}
}
// if default expectation was set then invocations count should be greater than zero
if m.DigestDataMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDigestDataCounter) < 1 {
return false
}
// if func was set then invocations count should be greater than zero
if m.funcDigestData != nil && mm_atomic.LoadUint64(&m.afterDigestDataCounter) < 1 {
return false
}
return true
}
// MinimockDigestDataInspect logs each unmet expectation
func (m *DataSignerMock) MinimockDigestDataInspect() {
for _, e := range m.DigestDataMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
m.t.Errorf("Expected call to DataSignerMock.DigestData with params: %#v", *e.params)
}
}
// if default expectation was set then invocations count should be greater than zero
if m.DigestDataMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterDigestDataCounter) < 1 {
if m.DigestDataMock.defaultExpectation.params == nil {
m.t.Error("Expected call to DataSignerMock.DigestData")
} else {
m.t.Errorf("Expected call to DataSignerMock.DigestData with params: %#v", *m.DigestDataMock.defaultExpectation.params)
}
}
// if func was set then invocations count should be greater than zero
if m.funcDigestData != nil && mm_atomic.LoadUint64(&m.afterDigestDataCounter) < 1 {
m.t.Error("Expected call to DataSignerMock.DigestData")
}
}
type mDataSignerMockGetDigestMethod struct {
mock *DataSignerMock
defaultExpectation *DataSignerMockGetDigestMethodExpectation
expectations []*DataSignerMockGetDigestMethodExpectation
}
// DataSignerMockGetDigestMethodExpectation specifies expectation struct of the DataSigner.GetDigestMethod
type DataSignerMockGetDigestMethodExpectation struct {
mock *DataSignerMock
results *DataSignerMockGetDigestMethodResults
Counter uint64
}
// DataSignerMockGetDigestMethodResults contains results of the DataSigner.GetDigestMethod
type DataSignerMockGetDigestMethodResults struct {
d1 DigestMethod
}
// Expect sets up expected params for DataSigner.GetDigestMethod
func (mmGetDigestMethod *mDataSignerMockGetDigestMethod) Expect() *mDataSignerMockGetDigestMethod {
if mmGetDigestMethod.mock.funcGetDigestMethod != nil {
mmGetDigestMethod.mock.t.Fatalf("DataSignerMock.GetDigestMethod mock is already set by Set")
}
if mmGetDigestMethod.defaultExpectation == nil {
mmGetDigestMethod.defaultExpectation = &DataSignerMockGetDigestMethodExpectation{}
}
return mmGetDigestMethod
}
// Inspect accepts an inspector function that has same arguments as the DataSigner.GetDigestMethod
func (mmGetDigestMethod *mDataSignerMockGetDigestMethod) Inspect(f func()) *mDataSignerMockGetDigestMethod {
if mmGetDigestMethod.mock.inspectFuncGetDigestMethod != nil {
mmGetDigestMethod.mock.t.Fatalf("Inspect function is already set for DataSignerMock.GetDigestMethod")
}
mmGetDigestMethod.mock.inspectFuncGetDigestMethod = f
return mmGetDigestMethod
}
// Return sets up results that will be returned by DataSigner.GetDigestMethod
func (mmGetDigestMethod *mDataSignerMockGetDigestMethod) Return(d1 DigestMethod) *DataSignerMock {
if mmGetDigestMethod.mock.funcGetDigestMethod != nil {
mmGetDigestMethod.mock.t.Fatalf("DataSignerMock.GetDigestMethod mock is already set by Set")
}
if mmGetDigestMethod.defaultExpectation == nil {
mmGetDigestMethod.defaultExpectation = &DataSignerMockGetDigestMethodExpectation{mock: mmGetDigestMethod.mock}
}
mmGetDigestMethod.defaultExpectation.results = &DataSignerMockGetDigestMethodResults{d1}
return mmGetDigestMethod.mock
}
//Set uses given function f to mock the DataSigner.GetDigestMethod method
func (mmGetDigestMethod *mDataSignerMockGetDigestMethod) Set(f func() (d1 DigestMethod)) *DataSignerMock {
if mmGetDigestMethod.defaultExpectation != nil {
mmGetDigestMethod.mock.t.Fatalf("Default expectation is already set for the DataSigner.GetDigestMethod method")
}
if len(mmGetDigestMethod.expectations) > 0 {
mmGetDigestMethod.mock.t.Fatalf("Some expectations are already set for the DataSigner.GetDigestMethod method")
}
mmGetDigestMethod.mock.funcGetDigestMethod = f
return mmGetDigestMethod.mock
}
// GetDigestMethod implements DataSigner
func (mmGetDigestMethod *DataSignerMock) GetDigestMethod() (d1 DigestMethod) {
mm_atomic.AddUint64(&mmGetDigestMethod.beforeGetDigestMethodCounter, 1)
defer mm_atomic.AddUint64(&mmGetDigestMethod.afterGetDigestMethodCounter, 1)
if mmGetDigestMethod.inspectFuncGetDigestMethod != nil {
mmGetDigestMethod.inspectFuncGetDigestMethod()
}
if mmGetDigestMethod.GetDigestMethodMock.defaultExpectation != nil {
mm_atomic.AddUint64(&mmGetDigestMethod.GetDigestMethodMock.defaultExpectation.Counter, 1)
mm_results := mmGetDigestMethod.GetDigestMethodMock.defaultExpectation.results
if mm_results == nil {
mmGetDigestMethod.t.Fatal("No results are set for the DataSignerMock.GetDigestMethod")
}
return (*mm_results).d1
}
if mmGetDigestMethod.funcGetDigestMethod != nil {
return mmGetDigestMethod.funcGetDigestMethod()
}
mmGetDigestMethod.t.Fatalf("Unexpected call to DataSignerMock.GetDigestMethod.")
return
}
// GetDigestMethodAfterCounter returns a count of finished DataSignerMock.GetDigestMethod invocations
func (mmGetDigestMethod *DataSignerMock) GetDigestMethodAfterCounter() uint64 {
return mm_atomic.LoadUint64(&mmGetDigestMethod.afterGetDigestMethodCounter)
}
// GetDigestMethodBeforeCounter returns a count of DataSignerMock.GetDigestMethod invocations
func (mmGetDigestMethod *DataSignerMock) GetDigestMethodBeforeCounter() uint64 {
return mm_atomic.LoadUint64(&mmGetDigestMethod.beforeGetDigestMethodCounter)
}
// MinimockGetDigestMethodDone returns true if the count of the GetDigestMethod invocations corresponds
// the number of defined expectations
func (m *DataSignerMock) MinimockGetDigestMethodDone() bool {
for _, e := range m.GetDigestMethodMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
return false
}
}
// if default expectation was set then invocations count should be greater than zero
if m.GetDigestMethodMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetDigestMethodCounter) < 1 {
return false
}
// if func was set then invocations count should be greater than zero
if m.funcGetDigestMethod != nil && mm_atomic.LoadUint64(&m.afterGetDigestMethodCounter) < 1 {
return false
}
return true
}
// MinimockGetDigestMethodInspect logs each unmet expectation
func (m *DataSignerMock) MinimockGetDigestMethodInspect() {
for _, e := range m.GetDigestMethodMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
m.t.Error("Expected call to DataSignerMock.GetDigestMethod")
}
}
// if default expectation was set then invocations count should be greater than zero
if m.GetDigestMethodMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetDigestMethodCounter) < 1 {
m.t.Error("Expected call to DataSignerMock.GetDigestMethod")
}
// if func was set then invocations count should be greater than zero
if m.funcGetDigestMethod != nil && mm_atomic.LoadUint64(&m.afterGetDigestMethodCounter) < 1 {
m.t.Error("Expected call to DataSignerMock.GetDigestMethod")
}
}
type mDataSignerMockGetDigestSize struct {
mock *DataSignerMock
defaultExpectation *DataSignerMockGetDigestSizeExpectation
expectations []*DataSignerMockGetDigestSizeExpectation
}
// DataSignerMockGetDigestSizeExpectation specifies expectation struct of the DataSigner.GetDigestSize
type DataSignerMockGetDigestSizeExpectation struct {
mock *DataSignerMock
results *DataSignerMockGetDigestSizeResults
Counter uint64
}
// DataSignerMockGetDigestSizeResults contains results of the DataSigner.GetDigestSize
type DataSignerMockGetDigestSizeResults struct {
i1 int
}
// Expect sets up expected params for DataSigner.GetDigestSize
func (mmGetDigestSize *mDataSignerMockGetDigestSize) Expect() *mDataSignerMockGetDigestSize {
if mmGetDigestSize.mock.funcGetDigestSize != nil {
mmGetDigestSize.mock.t.Fatalf("DataSignerMock.GetDigestSize mock is already set by Set")
}
if mmGetDigestSize.defaultExpectation == nil {
mmGetDigestSize.defaultExpectation = &DataSignerMockGetDigestSizeExpectation{}
}
return mmGetDigestSize
}
// Inspect accepts an inspector function that has same arguments as the DataSigner.GetDigestSize
func (mmGetDigestSize *mDataSignerMockGetDigestSize) Inspect(f func()) *mDataSignerMockGetDigestSize {
if mmGetDigestSize.mock.inspectFuncGetDigestSize != nil {
mmGetDigestSize.mock.t.Fatalf("Inspect function is already set for DataSignerMock.GetDigestSize")
}
mmGetDigestSize.mock.inspectFuncGetDigestSize = f
return mmGetDigestSize
}
// Return sets up results that will be returned by DataSigner.GetDigestSize
func (mmGetDigestSize *mDataSignerMockGetDigestSize) Return(i1 int) *DataSignerMock {
if mmGetDigestSize.mock.funcGetDigestSize != nil {
mmGetDigestSize.mock.t.Fatalf("DataSignerMock.GetDigestSize mock is already set by Set")
}
if mmGetDigestSize.defaultExpectation == nil {
mmGetDigestSize.defaultExpectation = &DataSignerMockGetDigestSizeExpectation{mock: mmGetDigestSize.mock}
}
mmGetDigestSize.defaultExpectation.results = &DataSignerMockGetDigestSizeResults{i1}
return mmGetDigestSize.mock
}
//Set uses given function f to mock the DataSigner.GetDigestSize method
func (mmGetDigestSize *mDataSignerMockGetDigestSize) Set(f func() (i1 int)) *DataSignerMock {
if mmGetDigestSize.defaultExpectation != nil {
mmGetDigestSize.mock.t.Fatalf("Default expectation is already set for the DataSigner.GetDigestSize method")
}
if len(mmGetDigestSize.expectations) > 0 {
mmGetDigestSize.mock.t.Fatalf("Some expectations are already set for the DataSigner.GetDigestSize method")
}
mmGetDigestSize.mock.funcGetDigestSize = f
return mmGetDigestSize.mock
}
// GetDigestSize implements DataSigner
func (mmGetDigestSize *DataSignerMock) GetDigestSize() (i1 int) {
mm_atomic.AddUint64(&mmGetDigestSize.beforeGetDigestSizeCounter, 1)
defer mm_atomic.AddUint64(&mmGetDigestSize.afterGetDigestSizeCounter, 1)
if mmGetDigestSize.inspectFuncGetDigestSize != nil {
mmGetDigestSize.inspectFuncGetDigestSize()
}
if mmGetDigestSize.GetDigestSizeMock.defaultExpectation != nil {
mm_atomic.AddUint64(&mmGetDigestSize.GetDigestSizeMock.defaultExpectation.Counter, 1)
mm_results := mmGetDigestSize.GetDigestSizeMock.defaultExpectation.results
if mm_results == nil {
mmGetDigestSize.t.Fatal("No results are set for the DataSignerMock.GetDigestSize")
}
return (*mm_results).i1
}
if mmGetDigestSize.funcGetDigestSize != nil {
return mmGetDigestSize.funcGetDigestSize()
}
mmGetDigestSize.t.Fatalf("Unexpected call to DataSignerMock.GetDigestSize.")
return
}
// GetDigestSizeAfterCounter returns a count of finished DataSignerMock.GetDigestSize invocations
func (mmGetDigestSize *DataSignerMock) GetDigestSizeAfterCounter() uint64 {
return mm_atomic.LoadUint64(&mmGetDigestSize.afterGetDigestSizeCounter)
}
// GetDigestSizeBeforeCounter returns a count of DataSignerMock.GetDigestSize invocations
func (mmGetDigestSize *DataSignerMock) GetDigestSizeBeforeCounter() uint64 {
return mm_atomic.LoadUint64(&mmGetDigestSize.beforeGetDigestSizeCounter)
}
// MinimockGetDigestSizeDone returns true if the count of the GetDigestSize invocations corresponds
// the number of defined expectations
func (m *DataSignerMock) MinimockGetDigestSizeDone() bool {
for _, e := range m.GetDigestSizeMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
return false
}
}
// if default expectation was set then invocations count should be greater than zero
if m.GetDigestSizeMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetDigestSizeCounter) < 1 {
return false
}
// if func was set then invocations count should be greater than zero
if m.funcGetDigestSize != nil && mm_atomic.LoadUint64(&m.afterGetDigestSizeCounter) < 1 {
return false
}
return true
}
// MinimockGetDigestSizeInspect logs each unmet expectation
func (m *DataSignerMock) MinimockGetDigestSizeInspect() {
for _, e := range m.GetDigestSizeMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
m.t.Error("Expected call to DataSignerMock.GetDigestSize")
}
}
// if default expectation was set then invocations count should be greater than zero
if m.GetDigestSizeMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetDigestSizeCounter) < 1 {
m.t.Error("Expected call to DataSignerMock.GetDigestSize")
}
// if func was set then invocations count should be greater than zero
if m.funcGetDigestSize != nil && mm_atomic.LoadUint64(&m.afterGetDigestSizeCounter) < 1 {
m.t.Error("Expected call to DataSignerMock.GetDigestSize")
}
}
type mDataSignerMockGetSignatureMethod struct {
mock *DataSignerMock
defaultExpectation *DataSignerMockGetSignatureMethodExpectation
expectations []*DataSignerMockGetSignatureMethodExpectation
}
// DataSignerMockGetSignatureMethodExpectation specifies expectation struct of the DataSigner.GetSignatureMethod
type DataSignerMockGetSignatureMethodExpectation struct {
mock *DataSignerMock
results *DataSignerMockGetSignatureMethodResults
Counter uint64
}
// DataSignerMockGetSignatureMethodResults contains results of the DataSigner.GetSignatureMethod
type DataSignerMockGetSignatureMethodResults struct {
s1 SignatureMethod
}
// Expect sets up expected params for DataSigner.GetSignatureMethod
func (mmGetSignatureMethod *mDataSignerMockGetSignatureMethod) Expect() *mDataSignerMockGetSignatureMethod {
if mmGetSignatureMethod.mock.funcGetSignatureMethod != nil {
mmGetSignatureMethod.mock.t.Fatalf("DataSignerMock.GetSignatureMethod mock is already set by Set")
}
if mmGetSignatureMethod.defaultExpectation == nil {
mmGetSignatureMethod.defaultExpectation = &DataSignerMockGetSignatureMethodExpectation{}
}
return mmGetSignatureMethod
}
// Inspect accepts an inspector function that has same arguments as the DataSigner.GetSignatureMethod
func (mmGetSignatureMethod *mDataSignerMockGetSignatureMethod) Inspect(f func()) *mDataSignerMockGetSignatureMethod {
if mmGetSignatureMethod.mock.inspectFuncGetSignatureMethod != nil {
mmGetSignatureMethod.mock.t.Fatalf("Inspect function is already set for DataSignerMock.GetSignatureMethod")
}
mmGetSignatureMethod.mock.inspectFuncGetSignatureMethod = f
return mmGetSignatureMethod
}
// Return sets up results that will be returned by DataSigner.GetSignatureMethod
func (mmGetSignatureMethod *mDataSignerMockGetSignatureMethod) Return(s1 SignatureMethod) *DataSignerMock {
if mmGetSignatureMethod.mock.funcGetSignatureMethod != nil {
mmGetSignatureMethod.mock.t.Fatalf("DataSignerMock.GetSignatureMethod mock is already set by Set")
}
if mmGetSignatureMethod.defaultExpectation == nil {
mmGetSignatureMethod.defaultExpectation = &DataSignerMockGetSignatureMethodExpectation{mock: mmGetSignatureMethod.mock}
}
mmGetSignatureMethod.defaultExpectation.results = &DataSignerMockGetSignatureMethodResults{s1}
return mmGetSignatureMethod.mock
}
//Set uses given function f to mock the DataSigner.GetSignatureMethod method
func (mmGetSignatureMethod *mDataSignerMockGetSignatureMethod) Set(f func() (s1 SignatureMethod)) *DataSignerMock {
if mmGetSignatureMethod.defaultExpectation != nil {
mmGetSignatureMethod.mock.t.Fatalf("Default expectation is already set for the DataSigner.GetSignatureMethod method")
}
if len(mmGetSignatureMethod.expectations) > 0 {
mmGetSignatureMethod.mock.t.Fatalf("Some expectations are already set for the DataSigner.GetSignatureMethod method")
}
mmGetSignatureMethod.mock.funcGetSignatureMethod = f
return mmGetSignatureMethod.mock
}
// GetSignatureMethod implements DataSigner
func (mmGetSignatureMethod *DataSignerMock) GetSignatureMethod() (s1 SignatureMethod) {
mm_atomic.AddUint64(&mmGetSignatureMethod.beforeGetSignatureMethodCounter, 1)
defer mm_atomic.AddUint64(&mmGetSignatureMethod.afterGetSignatureMethodCounter, 1)
if mmGetSignatureMethod.inspectFuncGetSignatureMethod != nil {
mmGetSignatureMethod.inspectFuncGetSignatureMethod()
}
if mmGetSignatureMethod.GetSignatureMethodMock.defaultExpectation != nil {
mm_atomic.AddUint64(&mmGetSignatureMethod.GetSignatureMethodMock.defaultExpectation.Counter, 1)
mm_results := mmGetSignatureMethod.GetSignatureMethodMock.defaultExpectation.results
if mm_results == nil {
mmGetSignatureMethod.t.Fatal("No results are set for the DataSignerMock.GetSignatureMethod")
}
return (*mm_results).s1
}
if mmGetSignatureMethod.funcGetSignatureMethod != nil {
return mmGetSignatureMethod.funcGetSignatureMethod()
}
mmGetSignatureMethod.t.Fatalf("Unexpected call to DataSignerMock.GetSignatureMethod.")
return
}
// GetSignatureMethodAfterCounter returns a count of finished DataSignerMock.GetSignatureMethod invocations
func (mmGetSignatureMethod *DataSignerMock) GetSignatureMethodAfterCounter() uint64 {
return mm_atomic.LoadUint64(&mmGetSignatureMethod.afterGetSignatureMethodCounter)
}
// GetSignatureMethodBeforeCounter returns a count of DataSignerMock.GetSignatureMethod invocations
func (mmGetSignatureMethod *DataSignerMock) GetSignatureMethodBeforeCounter() uint64 {
return mm_atomic.LoadUint64(&mmGetSignatureMethod.beforeGetSignatureMethodCounter)
}
// MinimockGetSignatureMethodDone returns true if the count of the GetSignatureMethod invocations corresponds
// the number of defined expectations
func (m *DataSignerMock) MinimockGetSignatureMethodDone() bool {
for _, e := range m.GetSignatureMethodMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
return false
}
}
// if default expectation was set then invocations count should be greater than zero
if m.GetSignatureMethodMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetSignatureMethodCounter) < 1 {
return false
}
// if func was set then invocations count should be greater than zero
if m.funcGetSignatureMethod != nil && mm_atomic.LoadUint64(&m.afterGetSignatureMethodCounter) < 1 {
return false
}
return true
}
// MinimockGetSignatureMethodInspect logs each unmet expectation
func (m *DataSignerMock) MinimockGetSignatureMethodInspect() {
for _, e := range m.GetSignatureMethodMock.expectations {
if mm_atomic.LoadUint64(&e.Counter) < 1 {
m.t.Error("Expected call to DataSignerMock.GetSignatureMethod")
}
}
// if default expectation was set then invocations count should be greater than zero
if m.GetSignatureMethodMock.defaultExpectation != nil && mm_atomic.LoadUint64(&m.afterGetSignatureMethodCounter) < 1 {
m.t.Error("Expected call to DataSignerMock.GetSignatureMethod")
}
// if func was set then invocations count should be greater than zero
if m.funcGetSignatureMethod != nil && mm_atomic.LoadUint64(&m.afterGetSignatureMethodCounter) < 1 {
m.t.Error("Expected call to DataSignerMock.GetSignatureMethod")
}
}
type mDataSignerMockGetSigningMethod struct {
mock *DataSignerMock
defaultExpectation *DataSignerMockGetSigningMethodExpectation
expectations []*DataSignerMockGetSigningMethodExpectation
}
// DataSignerMockGetSigningMethodExpectation specifies expectation struct of the DataSigner.GetSigningMethod
type DataSignerMockGetSigningMethodExpectation struct {
mock *DataSignerMock
results *DataSignerMockGetSigningMethodResults
Counter uint64
}
// DataSignerMockGetSigningMethodResults contains results of the DataSigner.GetSigningMethod
type DataSignerMockGetSigningMethodResults struct {
s1 SigningMethod
}
// Expect sets up expected params for DataSigner.GetSigningMethod
func (mmGetSigningMethod *mDataSignerMockGetSigningMethod) Expect() *mDataSignerMockGetSigningMethod {
if mmGetSigningMethod.mock.funcGetSigningMethod != nil {
mmGetSigningMethod.mock.t.Fatalf("DataSignerMock.GetSigningMethod mock is already set by Set")
}
if mmGetSigningMethod.defaultExpectation == nil {
mmGetSigningMethod.defaultExpectation = &DataSignerMockGetSigningMethodExpectation{}
}
return mmGetSigningMethod
}
// Inspect accepts an inspector function that has same arguments as the DataSigner.GetSigningMethod
func (mmGetSigningMethod *mDataSignerMockGetSigningMethod) Inspect(f func()) *mDataSignerMockGetSigningMethod {
if mmGetSigningMethod.mock.inspectFuncGetSigningMethod != nil {
mmGetSigningMethod.mock.t.Fatalf("Inspect function is already set for DataSignerMock.GetSigningMethod")
}
mmGetSigningMethod.mock.inspectFuncGetSigningMethod = f
return mmGetSigningMethod
}
// Return sets up results that will be returned by DataSigner.GetSigningMethod
func (mmGetSigningMethod *mDataSignerMockGetSigningMethod) Return(s1 SigningMethod) *DataSignerMock {
if mmGetSigningMethod.mock.funcGetSigningMethod != nil {