2021-10-25 13:20:30 +02:00
|
|
|
package thumb
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2021-11-09 11:42:10 +01:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2021-10-25 13:20:30 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestName_Jpeg(t *testing.T) {
|
|
|
|
t.Run("ResamplePng, FillCenter", func(t *testing.T) {
|
|
|
|
assert.Equal(t, "tile_50.jpg", Tile50.Jpeg())
|
|
|
|
})
|
|
|
|
}
|
2022-07-06 23:01:54 +02:00
|
|
|
|
|
|
|
func TestFind(t *testing.T) {
|
|
|
|
t.Run("2048", func(t *testing.T) {
|
|
|
|
name, size := Find(2048)
|
|
|
|
assert.Equal(t, Fit2048, name)
|
|
|
|
assert.Equal(t, 2048, size.Width)
|
|
|
|
assert.Equal(t, 2048, size.Height)
|
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("2000", func(t *testing.T) {
|
|
|
|
name, size := Find(2000)
|
|
|
|
assert.Equal(t, Fit1920, name)
|
|
|
|
assert.Equal(t, 1920, size.Width)
|
|
|
|
assert.Equal(t, 1200, size.Height)
|
|
|
|
})
|
|
|
|
}
|