18 lines
384 B
Go
18 lines
384 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func TestCartIdsNullData(t *testing.T) {
|
|
data := MakeCartInnerFrame(ToCartId("kalle"), nil)
|
|
cart, err := GetCartFrame(data)
|
|
if err != nil {
|
|
t.Errorf("Error getting cart: %v", err)
|
|
}
|
|
if cart.Id.String() != "kalle" {
|
|
t.Errorf("Expected kalle, got %s", cart.Id)
|
|
}
|
|
if len(cart.Data) != 0 {
|
|
t.Errorf("Expected no data, got %v", cart.Data)
|
|
}
|
|
}
|