You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
707 B
Go
38 lines
707 B
Go
package diyanetapi
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"prayertimes/internal/net"
|
|
"prayertimes/pkg/prayer"
|
|
)
|
|
|
|
func TestDiyanetAPI_GetByCoords(t *testing.T) {
|
|
p := New(net.ReqClient)
|
|
t.Run("by coords", func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
times, err := p.GetByCoords(context.Background(), prayer.Coordinates{
|
|
Latitude: 52.5100846,
|
|
Longitude: 13.4518284,
|
|
})
|
|
assert.NoError(t, err)
|
|
assert.NotEmpty(t, times)
|
|
t.Logf("%#+v", times[0])
|
|
})
|
|
|
|
t.Run("by id", func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
times, err := p.Get(context.Background(), "11104")
|
|
assert.NoError(t, err)
|
|
assert.NotEmpty(t, times)
|
|
for _, time := range times {
|
|
t.Log(time)
|
|
}
|
|
})
|
|
}
|