diff --git a/model_test.go b/model_test.go index bb54da3..702bb4c 100644 --- a/model_test.go +++ b/model_test.go @@ -155,12 +155,12 @@ func TestModel_Swap(t *testing.T) { iti_single.Author = &author storyDoc := Create(iti_single).(*story) saveDoc(t, storyDoc) - storyDoc.Chapters[0].Bands = append(storyDoc.Chapters[0].Bands, metallica) + storyDoc.Chapters[0].Bands = append(storyDoc.Chapters[0].Bands, bodom) assert.Equal(t, 2, len(storyDoc.Chapters[0].Bands)) err := storyDoc.Swap("Chapters[0].Bands", 0, 1) assert.Nil(t, err) c := storyDoc.Chapters[0].Bands - assert.Equal(t, metallica.ID, c[0].ID) - assert.Equal(t, dh.ID, c[1].ID) + assert.Equal(t, bodom.ID, c[0].ID) + assert.Equal(t, diamondHead.ID, c[1].ID) saveDoc(t, storyDoc) } diff --git a/testing.go b/testing.go index e92e906..0807f61 100644 --- a/testing.go +++ b/testing.go @@ -138,13 +138,13 @@ func genChaps(single bool) []chapter { return ret } -var iti_single story = story{ +var iti_single = story{ Title: "title", Completed: true, Chapters: genChaps(true), } -var iti_multi story = story{ +var iti_multi = story{ Title: "Brian Tatler Fucked and Abused Sean Harris", Completed: false, Chapters: genChaps(false), @@ -190,11 +190,30 @@ var metallica = band{ Locked: false, } -var dh = band{ - ID: 503, - Name: "Diamond Head", - Locked: false, - Characters: []string{"Brian Tatler", "Sean Harris", "Duncan Scott", "Colin Kimberley"}, +var diamondHead = band{ + ID: 503, + Name: "Diamond Head", + Locked: false, + Characters: []string{ + "Brian Tatler", + "Sean Harris", + "Duncan Scott", + "Colin Kimberley", + }, +} +var bodom = band{ + ID: 74, + Name: "Children of Bodom", + Locked: false, + Characters: []string{ + "Janne Wirman", + "Alexi Laiho", + "Jaska Raatikainen", + "Henkka T. Blacksmith", + "Roope Latvala", + "Daniel Freyberg", + "Alexander Kuoppala", + }, } func saveDoc(t *testing.T, doc IModel) {