Files
cloud-services/pkg/common/supplier_account_test.go

39 lines
1.0 KiB
Go

package common_test
import (
"testing"
"time"
"fiskerinc.com/modules/common"
"fiskerinc.com/modules/common/dbbasemodel"
"fiskerinc.com/modules/testhelper"
)
func TestSupplierAccount(t *testing.T) {
now := time.Now()
expected := "SupplierAccount<Test Company, 555 Main, San Francisco, CA 94103, Test Contact, +1 555-555-5555, test@test.com, Test Program, <nil>, <nil>, <nil>, <nil>, <nil>>"
supplier := common.SupplierAccount{
Email: " TEST@TEST.COM ",
Company: " Test Company ",
Contact: " Test Contact ",
Address: " 555 Main, San Francisco, CA 94103 ",
Telephone: " +1 555-555-5555 ",
Program: " Test Program ",
ECUs: []string{"", " TEST ", "TEST1 "},
ActivatedAt: &now,
KeysAt: &now,
SigninAt: &now,
DBModelBase: dbbasemodel.DBModelBase{
CreatedAt: &now,
UpdatedAt: &now,
},
}
supplier.SanitizeData()
actual := supplier.String()
if actual != expected {
t.Errorf(testhelper.TestErrorTemplate, "SupplierAccount", expected, actual)
}
}