ess-etl-go/internal/xml_loader/employee_wi_test.go

23 lines
621 B
Go

package xml_loader_test
import (
"testing"
"gitea.urkob.com/urko/ess-etl-go/config"
"gitea.urkob.com/urko/ess-etl-go/internal/request"
"gitea.urkob.com/urko/ess-etl-go/internal/xml_loader"
"github.com/stretchr/testify/require"
)
func TestEmployeeWILoader_LoadEmployee(t *testing.T) {
cfg := config.NewConfig(".env")
r := request.NewRequestService(cfg.AmsApi, cfg.AmsApiKey)
loader := xml_loader.NewEmployeeWILoader(r)
employeeID, from, to := cfg.EmployeeIdList[0], "2023-01-01", "2023-01-31"
got, err := loader.LoadEmployee(employeeID, from, to)
require.NoError(t, err)
require.Greater(t, len(got), 0)
}