2020-05-11 11:01:28 +02:00
|
|
|
package entity
|
2020-05-08 15:41:01 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2022-04-10 14:38:51 +02:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2020-05-08 15:41:01 +02:00
|
|
|
)
|
|
|
|
|
2022-04-10 14:38:51 +02:00
|
|
|
func TestCount(t *testing.T) {
|
|
|
|
m := PhotoFixtures.Pointer("Photo01")
|
|
|
|
_, keys, err := ModelValues(m, "ID", "PhotoUID")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
result := Count(m, []string{"ID", "PhotoUID"}, keys)
|
|
|
|
|
|
|
|
assert.Equal(t, 1, result)
|
|
|
|
}
|