Tests: Refactor unit tests

This commit is contained in:
graciousgrey 2023-09-12 14:04:52 +02:00
parent ee97436539
commit f12c558f67
3 changed files with 5 additions and 5 deletions

View file

@ -16,13 +16,13 @@ func TestRandomAngle(t *testing.T) {
assert.GreaterOrEqual(t, a, -1*e)
}
})
t.Run("max<0", func(t *testing.T) {
t.Run("MaxTooLow", func(t *testing.T) {
e := float64(-35)
a := RandomAngle(e)
assert.GreaterOrEqual(t, a, e)
assert.LessOrEqual(t, a, -1*e)
})
t.Run("max>180", func(t *testing.T) {
t.Run("MaxTooHigh", func(t *testing.T) {
e := float64(200)
a := RandomAngle(e)
assert.LessOrEqual(t, a, e)

View file

@ -60,7 +60,7 @@ func TestCollage(t *testing.T) {
_ = os.Remove(saveName)
})
t.Run("No images", func(t *testing.T) {
t.Run("NoImages", func(t *testing.T) {
var images []image.Image
saveName := "testdata/test-no-images-collage.jpg"
@ -77,7 +77,7 @@ func TestCollage(t *testing.T) {
_ = os.Remove(saveName)
})
t.Run("Unknown collage type", func(t *testing.T) {
t.Run("UnknownCollageType", func(t *testing.T) {
var images []image.Image
img, err := imaging.Open("testdata/500x500.jpg")

View file

@ -30,7 +30,7 @@ func TestImage(t *testing.T) {
_ = os.Remove(saveName)
})
t.Run("Unknown type", func(t *testing.T) {
t.Run("UnknownType", func(t *testing.T) {
img, err := imaging.Open("testdata/500x500.jpg")
assert.NoError(t, err)