Files
excelConverter/pkg/loader/loader_test.go
Andreas Schröpfer 7270660f2c #7 #2 tests added
2021-03-01 20:15:25 +01:00

24 lines
524 B
Go

package loader
import (
"bytes"
_ "embed"
"testing"
"github.com/matryer/is"
)
//go:embed test/testfile.xlsx
var tb []byte
func TestXLSX(t *testing.T) {
is := is.New(t)
buf := bytes.NewBuffer(tb)
got, err := XLSX(buf, nil)
is.NoErr(err) // no error for testfile
is.Equal(got.Version, "5.04") // version 5.04
is.Equal(got.CompanyFacts.TotalPurchaseFromSuppliers, 10000)
is.Equal(got.CompanyFacts.SupplyFractions[0].Costs, 500)
is.Equal(got.CompanyFacts.SupplyFractions[0].CountryCode, "ALB")
}