2021-09-21 09:51:48 +02:00
|
|
|
package face
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2021-09-23 13:16:05 +02:00
|
|
|
func TestQualityThreshold(t *testing.T) {
|
2021-09-21 11:03:07 +02:00
|
|
|
t.Run("XXS", func(t *testing.T) {
|
2021-09-23 13:16:05 +02:00
|
|
|
assert.Equal(t, float32(35), QualityThreshold(21))
|
2021-09-21 09:51:48 +02:00
|
|
|
})
|
2021-09-21 11:03:07 +02:00
|
|
|
t.Run("XS", func(t *testing.T) {
|
2021-09-23 13:16:05 +02:00
|
|
|
assert.Equal(t, float32(25), QualityThreshold(27))
|
2021-09-21 11:03:07 +02:00
|
|
|
})
|
|
|
|
t.Run("S", func(t *testing.T) {
|
2021-09-23 13:16:05 +02:00
|
|
|
assert.Equal(t, float32(20), QualityThreshold(33))
|
2021-09-21 11:03:07 +02:00
|
|
|
})
|
|
|
|
t.Run("M", func(t *testing.T) {
|
2021-09-23 13:16:05 +02:00
|
|
|
assert.Equal(t, float32(18), QualityThreshold(45))
|
2021-09-21 11:03:07 +02:00
|
|
|
})
|
|
|
|
t.Run("L", func(t *testing.T) {
|
2021-09-23 13:16:05 +02:00
|
|
|
assert.Equal(t, float32(15), QualityThreshold(75))
|
2021-09-21 09:51:48 +02:00
|
|
|
})
|
2021-09-21 11:03:07 +02:00
|
|
|
t.Run("XL", func(t *testing.T) {
|
2021-09-23 13:16:05 +02:00
|
|
|
assert.Equal(t, float32(11), QualityThreshold(100))
|
2021-09-21 11:03:07 +02:00
|
|
|
})
|
|
|
|
t.Run("XXL", func(t *testing.T) {
|
2021-09-23 13:16:05 +02:00
|
|
|
assert.Equal(t, float32(9), QualityThreshold(250))
|
2021-09-21 09:51:48 +02:00
|
|
|
})
|
|
|
|
}
|