Add tests for AlbumPlayCountMode, change the calc to match the request from #1032
This commit is contained in:
@@ -120,10 +120,13 @@ var _ = Describe("AlbumRepository", func() {
|
||||
albums := repo.toModels(dba)
|
||||
Expect(albums[0].PlayCount).To(Equal(int64(expected)))
|
||||
},
|
||||
Entry("1 song, 0 plays", 1, 0, 0),
|
||||
Entry("1 song, 4 plays", 1, 4, 4),
|
||||
Entry("3 songs, 6 plays", 3, 6, 6),
|
||||
Entry("10 songs, 6 plays", 10, 6, 6),
|
||||
Entry("70 songs, 70 plays", 70, 70, 70),
|
||||
Entry("10 songs, 50 plays", 10, 50, 50),
|
||||
Entry("120 songs, 121 plays", 120, 121, 121),
|
||||
)
|
||||
|
||||
DescribeTable("normalizes play count when AlbumPlayCountMode is normalized",
|
||||
@@ -135,10 +138,13 @@ var _ = Describe("AlbumRepository", func() {
|
||||
albums := repo.toModels(dba)
|
||||
Expect(albums[0].PlayCount).To(Equal(int64(expected)))
|
||||
},
|
||||
Entry("1 song, 0 plays", 1, 0, 0),
|
||||
Entry("1 song, 4 plays", 1, 4, 4),
|
||||
Entry("3 songs, 6 plays", 3, 6, 2),
|
||||
Entry("10 songs, 6 plays", 10, 6, 1),
|
||||
Entry("70 songs, 70 plays", 70, 70, 1),
|
||||
Entry("10 songs, 50 plays", 10, 50, 5),
|
||||
Entry("120 songs, 121 plays", 120, 121, 1),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user