Skip to content

Commit 99cb7b5

Browse files
committed
chore(mock): regenerate mocks
1 parent a452d49 commit 99cb7b5

10 files changed

Lines changed: 48 additions & 45 deletions

File tree

internal/credits/credits_mock.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/credits/credits_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func Test_creditsInteractor_RenderCredits(t *testing.T) {
258258
for _, tt := range tests {
259259
t.Run(tt.name, func(t *testing.T) {
260260
ci := creditsInteractor{}
261-
ci.RenderCredits(context.Background(), tt.initCanv(ctrl), tt.args.y, tt.args.metadata)
261+
ci.RenderCredits(context.Background(), tt.initCanv(ctrl), tt.args.y, tt.args.metadata, nil)
262262
})
263263
}
264264
}

internal/lyric/lyric_mock.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/lyric/verse_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func Test_lyricInteractor_RenderVerse(t *testing.T) {
2727

2828
type args struct {
2929
y int
30-
verses []repository.HymnVerse
30+
verses map[int]repository.HymnVerse
3131
}
3232
tests := []struct {
3333
name string
@@ -39,8 +39,8 @@ func Test_lyricInteractor_RenderVerse(t *testing.T) {
3939
name: "KJ-002. 1column",
4040
args: args{
4141
y: 100,
42-
verses: []repository.HymnVerse{
43-
repository.HymnVerse{
42+
verses: map[int]repository.HymnVerse{
43+
2: repository.HymnVerse{
4444
Number: sql.NullInt32{Int32: 2, Valid: true},
4545
VerseNum: sql.NullInt32{Int32: 2, Valid: true},
4646
Row: sql.NullInt16{Int16: 1, Valid: true},
@@ -75,16 +75,16 @@ func Test_lyricInteractor_RenderVerse(t *testing.T) {
7575
name: "KJ-005. 2column",
7676
args: args{
7777
y: 100,
78-
verses: []repository.HymnVerse{
79-
repository.HymnVerse{
78+
verses: map[int]repository.HymnVerse{
79+
2: repository.HymnVerse{
8080
Number: sql.NullInt32{Int32: 5, Valid: true},
8181
VerseNum: sql.NullInt32{Int32: 2, Valid: true},
8282
Row: sql.NullInt16{Int16: 1, Valid: true},
8383
StyleRow: sql.NullInt32{Int32: 6, Valid: true},
8484
Col: sql.NullInt16{Int16: 1, Valid: true},
8585
Content: sql.NullString{String: verse2a, Valid: true},
8686
},
87-
repository.HymnVerse{
87+
3: repository.HymnVerse{
8888
Number: sql.NullInt32{Int32: 5, Valid: true},
8989
VerseNum: sql.NullInt32{Int32: 3, Valid: true},
9090
Row: sql.NullInt16{Int16: 1, Valid: true},
@@ -130,24 +130,24 @@ func Test_lyricInteractor_RenderVerse(t *testing.T) {
130130
name: "KJ-026. mixed 2 and 1 column",
131131
args: args{
132132
y: 100,
133-
verses: []repository.HymnVerse{
134-
repository.HymnVerse{
133+
verses: map[int]repository.HymnVerse{
134+
2: repository.HymnVerse{
135135
Number: sql.NullInt32{Int32: 5, Valid: true},
136136
VerseNum: sql.NullInt32{Int32: 2, Valid: true},
137137
Row: sql.NullInt16{Int16: 1, Valid: true},
138138
StyleRow: sql.NullInt32{Int32: 6, Valid: true},
139139
Col: sql.NullInt16{Int16: 1, Valid: true},
140140
Content: sql.NullString{String: verse3a, Valid: true},
141141
},
142-
repository.HymnVerse{
142+
3: repository.HymnVerse{
143143
Number: sql.NullInt32{Int32: 5, Valid: true},
144144
VerseNum: sql.NullInt32{Int32: 3, Valid: true},
145145
Row: sql.NullInt16{Int16: 1, Valid: true},
146146
StyleRow: sql.NullInt32{Int32: 6, Valid: true},
147147
Col: sql.NullInt16{Int16: 2, Valid: true},
148148
Content: sql.NullString{String: verse3b, Valid: true},
149149
},
150-
repository.HymnVerse{
150+
4: repository.HymnVerse{
151151
Number: sql.NullInt32{Int32: 5, Valid: true},
152152
VerseNum: sql.NullInt32{Int32: 4, Valid: true},
153153
Row: sql.NullInt16{Int16: 2, Valid: true},
@@ -196,7 +196,7 @@ func Test_lyricInteractor_RenderVerse(t *testing.T) {
196196
for _, tt := range tests {
197197
t.Run(tt.name, func(t *testing.T) {
198198
li := lyricInteractor{}
199-
if got := li.RenderVerse(context.Background(), tt.initCanvas(ctrl), tt.args.y, tt.args.verses); !reflect.DeepEqual(got, tt.want) {
199+
if got := li.RenderVerse(context.Background(), tt.initCanvas(ctrl), tt.args.y, tt.args.verses, nil); !reflect.DeepEqual(got, tt.want) {
200200
t.Errorf("lyricInteractor.RenderVerse() = %v, want %v", got, tt.want)
201201
}
202202
})

internal/musicxml/entity_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func TestMeasure_Build(t *testing.T) {
8484
RightMeasureText: &MeasureText{
8585
Text: "Refrein",
8686
},
87-
NewLineIndex: -1,
87+
NewLineIndex: map[int]bool{},
8888
},
8989
},
9090
{
@@ -178,7 +178,7 @@ func TestMeasure_Build(t *testing.T) {
178178
},
179179
},
180180
},
181-
NewLineIndex: -1,
181+
NewLineIndex: map[int]bool{},
182182
},
183183
},
184184
{
@@ -267,7 +267,7 @@ func TestMeasure_Build(t *testing.T) {
267267
},
268268
},
269269
},
270-
NewLineIndex: 1,
270+
NewLineIndex: map[int]bool{},
271271
},
272272
},
273273
{
@@ -343,7 +343,7 @@ func TestMeasure_Build(t *testing.T) {
343343
},
344344
},
345345
},
346-
NewLineIndex: -1,
346+
NewLineIndex: map[int]bool{},
347347
},
348348
},
349349
}

internal/renderer/renderer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func Test_rendererInteractor_Render(t *testing.T) {
152152
},
153153
Title: "Unittest",
154154
},
155-
Verse: []repository.HymnVerse{},
155+
Verse: map[int]repository.HymnVerse{},
156156
},
157157
music: musicxml.MusicXML{
158158
Part: musicxml.Part{
@@ -188,7 +188,7 @@ func Test_rendererInteractor_Render(t *testing.T) {
188188
l.EXPECT().CalculateLyricWidth("do = d").Return(float64(100))
189189

190190
l.EXPECT().CalculateLyricWidth("1. UNITTEST").Return(float64(100))
191-
l.EXPECT().RenderVerse(gomock.Any(), gomock.Any(), int(490), []repository.HymnVerse{}).Return(lyric.VerseInfo{MarginBottom: 40})
191+
l.EXPECT().RenderVerse(gomock.Any(), gomock.Any(), int(490), map[int]repository.HymnVerse{}, nil).Return(lyric.VerseInfo{MarginBottom: 40})
192192

193193
return l
194194
},
@@ -250,7 +250,7 @@ func Test_rendererInteractor_Render(t *testing.T) {
250250
Number: 1,
251251
},
252252
Title: "Unittest",
253-
})
253+
}, nil)
254254

255255
return cMock
256256
},

internal/rhythm/rhythm_mock.go

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/staff/align_mock.go

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/staff/align_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/jodi-ivan/numbered-notation-xml/internal/musicxml"
1212
"github.com/jodi-ivan/numbered-notation-xml/internal/numbered"
1313
"github.com/jodi-ivan/numbered-notation-xml/internal/rhythm"
14+
"github.com/jodi-ivan/numbered-notation-xml/internal/timesig"
1415
"github.com/jodi-ivan/numbered-notation-xml/utils/canvas"
1516
)
1617

@@ -344,7 +345,7 @@ func Test_renderStaffAlign_RenderWithAlign(t *testing.T) {
344345
})
345346

346347
numberedMock.EXPECT().RenderOctave(gomock.Any(), gomock.Any(), gomock.Any())
347-
rhythmMock.EXPECT().RenderBeam(gomock.Any(), gomock.Any(), gomock.Any())
348+
rhythmMock.EXPECT().RenderBeam(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any())
348349
rhythmMock.EXPECT().RenderSlurTies(gomock.Any(), gomock.Any(), IsEqual([]*entity.NoteRenderer{
349350
&entity.NoteRenderer{
350351
PositionX: 384,
@@ -400,7 +401,7 @@ func Test_renderStaffAlign_RenderWithAlign(t *testing.T) {
400401
}
401402
for _, tt := range tests {
402403
t.Run(tt.name, func(t *testing.T) {
403-
(tt.interactor(ctrl)).RenderWithAlign(context.Background(), tt.canv(ctrl), tt.args.y, tt.args.noteRenderer)
404+
(tt.interactor(ctrl)).RenderWithAlign(context.Background(), tt.canv(ctrl), tt.args.y, timesig.TimeSignature{}, tt.args.noteRenderer)
404405
})
405406
}
406407
}

internal/staff/staff_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func Test_staffInteractor_RenderStaff(t *testing.T) {
230230
note[0],
231231
note[1],
232232
},
233-
NewLineIndex: -1,
233+
NewLineIndex: map[int]bool{},
234234
}
235235
var emptyCoordinate *entity.Coordinate
236236
barlineMock.EXPECT().GetRendererLeftBarline(IsEqual(measures, t), int(50), emptyCoordinate).Return(&entity.NoteRenderer{
@@ -264,7 +264,7 @@ func Test_staffInteractor_RenderStaff(t *testing.T) {
264264

265265
barlineMock.EXPECT().GetRendererRightBarline(IsEqual(measures, t), int(25)).Return(25, &entity.NoteRenderer{Barline: &musicxml.Barline{Location: musicxml.BarlineLocationRight, BarStyle: musicxml.BarLineStyleRegular}})
266266

267-
renderAlign.EXPECT().RenderWithAlign(gomock.Any(), gomock.Any(), int(80), IsEqual([][]*entity.NoteRenderer{
267+
renderAlign.EXPECT().RenderWithAlign(gomock.Any(), gomock.Any(), int(80), timeSignature, IsEqual([][]*entity.NoteRenderer{
268268
[]*entity.NoteRenderer{
269269
&entity.NoteRenderer{
270270
Barline: &musicxml.Barline{
@@ -503,7 +503,7 @@ func Test_staffInteractor_RenderStaff(t *testing.T) {
503503
musicxml.Element{Content: `<pitch><step>A</step><octave>4</octave></pitch><duration>8</duration><voice>1</voice><type>whole</type><notations><articulations><breath-mark/></articulations></notations><lyric number="1"><syllabic>end</syllabic><text>duh.</text></lyric>`},
504504
},
505505
Notes: notes,
506-
NewLineIndex: 1,
506+
NewLineIndex: map[int]bool{1: true},
507507
Barline: []musicxml.Barline{},
508508
}
509509

@@ -544,7 +544,7 @@ func Test_staffInteractor_RenderStaff(t *testing.T) {
544544
barlineMock.EXPECT().GetRendererRightBarline(IsEqual(measure, t), int(50)).Return(int(50), &entity.NoteRenderer{Barline: &musicxml.Barline{BarStyle: musicxml.BarLineStyleRegular}})
545545

546546
// the last param still gomock.Any() cause there is dotted line that needs to be handled for the new line
547-
renderAlign.EXPECT().RenderWithAlign(gomock.Any(), gomock.Any(), int(80), gomock.Any())
547+
renderAlign.EXPECT().RenderWithAlign(gomock.Any(), gomock.Any(), int(80), gomock.Any(), gomock.Any())
548548

549549
return si
550550
},

0 commit comments

Comments
 (0)