photoprism/internal/search/geojson_result_test.go

41 lines
765 B
Go
Raw Normal View History

package search
2020-05-13 11:57:54 +02:00
import (
"testing"
"time"
2020-11-21 18:08:41 +01:00
"github.com/stretchr/testify/assert"
2020-05-13 11:57:54 +02:00
)
func TestGeoResult_Lat(t *testing.T) {
geo := GeoResult{
ID: "123",
PhotoLat: 7.775,
PhotoLng: 8.775,
PhotoUID: "",
2020-05-13 11:57:54 +02:00
PhotoTitle: "",
PhotoFavorite: false,
FileHash: "",
FileWidth: 0,
FileHeight: 0,
TakenAt: time.Time{},
}
assert.Equal(t, 7.775000095367432, geo.Lat())
}
func TestGeoResult_Lng(t *testing.T) {
geo := GeoResult{
ID: "123",
PhotoLat: 7.775,
PhotoLng: 8.775,
PhotoUID: "",
2020-05-13 11:57:54 +02:00
PhotoTitle: "",
PhotoFavorite: false,
FileHash: "",
FileWidth: 0,
FileHeight: 0,
TakenAt: time.Time{},
}
assert.Equal(t, 8.774999618530273, geo.Lng())
}