Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
38
pkg/common/supplier_account_test.go
Normal file
38
pkg/common/supplier_account_test.go
Normal file
@@ -0,0 +1,38 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user