diff --git a/internal/handlers/prices_test.go b/internal/handlers/prices_test.go index d362614..1cbca93 100644 --- a/internal/handlers/prices_test.go +++ b/internal/handlers/prices_test.go @@ -64,7 +64,7 @@ func TestCreatePrice(t *testing.T) { if p.CurrencyId != d.securities[orig.CurrencyId].SecurityId { t.Errorf("CurrencyId doesn't match") } - if p.Date != orig.Date { + if !p.Date.Equal(orig.Date) { t.Errorf("Date doesn't match") } if p.Value != orig.Value { @@ -94,7 +94,7 @@ func TestGetPrice(t *testing.T) { if p.CurrencyId != d.securities[orig.CurrencyId].SecurityId { t.Errorf("CurrencyId doesn't match") } - if p.Date != orig.Date { + if !p.Date.Equal(orig.Date) { t.Errorf("Date doesn't match") } if p.Value != orig.Value { @@ -131,7 +131,7 @@ func TestGetPrices(t *testing.T) { found := false for _, p := range *pl.Prices { - if p.SecurityId == d.securities[orig.SecurityId].SecurityId && p.CurrencyId == d.securities[orig.CurrencyId].SecurityId && p.Date == orig.Date && p.Value == orig.Value && p.RemoteId == orig.RemoteId { + if p.SecurityId == d.securities[orig.SecurityId].SecurityId && p.CurrencyId == d.securities[orig.CurrencyId].SecurityId && p.Date.Equal(orig.Date) && p.Value == orig.Value && p.RemoteId == orig.RemoteId { if _, ok := foundIds[p.PriceId]; ok { continue } @@ -177,7 +177,7 @@ func TestUpdatePrice(t *testing.T) { if p.CurrencyId != curr.CurrencyId { t.Errorf("CurrencyId doesn't match") } - if p.Date != curr.Date { + if !p.Date.Equal(curr.Date) { t.Errorf("Date doesn't match") } if p.Value != curr.Value { diff --git a/internal/handlers/transactions_test.go b/internal/handlers/transactions_test.go index 84f1c2e..9a7a9f2 100644 --- a/internal/handlers/transactions_test.go +++ b/internal/handlers/transactions_test.go @@ -87,8 +87,8 @@ func ensureTransactionsMatch(t *testing.T, expected, tran *handlers.Transaction, if tran.Description != expected.Description { t.Errorf("Description doesn't match") } - if tran.Date != expected.Date { - t.Errorf("Date doesn't match") + if !tran.Date.Equal(expected.Date) { + t.Errorf("Date (%+v) differs from expected (%+v)", tran.Date, expected.Date) } if len(tran.Splits) != len(expected.Splits) {