more tests
This commit is contained in:
@@ -32,6 +32,19 @@ func TestPriceMarshalJSON(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewPriceFromIncVat(t *testing.T) {
|
||||
p := NewPriceFromIncVat(1000, 0.25)
|
||||
if p.IncVat != 1000 {
|
||||
t.Fatalf("expected IncVat %d got %d", 1000, p.IncVat)
|
||||
}
|
||||
if p.VatRates[25] != 250 {
|
||||
t.Fatalf("expected VAT 25 rate %d got %d", 250, p.VatRates[25])
|
||||
}
|
||||
if p.ValueExVat() != 750 {
|
||||
t.Fatalf("expected exVat %d got %d", 750, p.ValueExVat())
|
||||
}
|
||||
}
|
||||
|
||||
func TestSumPrices(t *testing.T) {
|
||||
// We'll construct prices via raw struct since constructor expects tax math.
|
||||
// IncVat already includes vat portions.
|
||||
|
||||
Reference in New Issue
Block a user