link user
This commit is contained in:
@@ -184,6 +184,13 @@ func TestBuyXGetYEffect(t *testing.T) {
|
||||
if got := g.TotalPrice.IncVat; got != 2000 {
|
||||
t.Errorf("total price = %d, want 2000", got)
|
||||
}
|
||||
if len(g.AppliedPromotions) != 1 {
|
||||
t.Fatalf("expected 1 applied promotion, got %d", len(g.AppliedPromotions))
|
||||
}
|
||||
itemIds := g.AppliedPromotions[0].ItemIds
|
||||
if len(itemIds) != 1 || itemIds[0] != 1 {
|
||||
t.Errorf("expected affected itemIds [1], got %v", itemIds)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBundleDiscountEffect(t *testing.T) {
|
||||
@@ -247,4 +254,11 @@ func TestBundleDiscountEffect(t *testing.T) {
|
||||
if got := g.TotalPrice.IncVat; got != 4000 {
|
||||
t.Errorf("total price = %d, want 4000", got)
|
||||
}
|
||||
if len(g.AppliedPromotions) != 1 {
|
||||
t.Fatalf("expected 1 applied promotion, got %d", len(g.AppliedPromotions))
|
||||
}
|
||||
itemIds := g.AppliedPromotions[0].ItemIds
|
||||
if len(itemIds) != 2 || itemIds[0] != 1 || itemIds[1] != 2 {
|
||||
t.Errorf("expected affected itemIds [1, 2], got %v", itemIds)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user