22 lines
436 B
Go
22 lines
436 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"github.com/stretchr/testify/require"
|
||
|
)
|
||
|
|
||
|
func Test_parseData(t *testing.T) {
|
||
|
db, err := parseData()
|
||
|
require.NoError(t, err)
|
||
|
|
||
|
stations, err := findStations(db, "Braunschweig")
|
||
|
require.NoError(t, err)
|
||
|
|
||
|
if assert.Len(t, stations, 2) {
|
||
|
assert.Equal(t, "Braunschweig Hbf", stations[0].name)
|
||
|
assert.Equal(t, "Braunschweig-Gliesmarode", stations[1].name)
|
||
|
}
|
||
|
}
|