From 3bdf433b20d4f8320ba35393c5419a2268dbfad6 Mon Sep 17 00:00:00 2001 From: Christian Banse Date: Wed, 1 Jan 2025 14:50:09 +0100 Subject: [PATCH] Package securities/quote also tests --- securities/quote/quote_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/securities/quote/quote_test.go b/securities/quote/quote_test.go index 253fed8b..1226f457 100644 --- a/securities/quote/quote_test.go +++ b/securities/quote/quote_test.go @@ -44,6 +44,10 @@ func (mockQuoteProvider) LatestQuote(_ context.Context, _ *persistence.ListedSec return currency.Value(100), time.Date(1, 0, 0, 0, 0, 0, 0, time.UTC), nil } +func init() { + RegisterQuoteProvider(QuoteProviderMock, &mockQP{}) +} + func Test_qu_updateQuote(t *testing.T) { type fields struct { db *persistence.DB @@ -81,7 +85,7 @@ func Test_qu_updateQuote(t *testing.T) { ls: &persistence.ListedSecurity{SecurityID: "My Security", Ticker: "SEC", Currency: "EUR"}, }, want: func(t *testing.T, ls *persistence.ListedSecurity) bool { - return assert.Equals(t, 100, int(ls.LatestQuote.Int64)) + return assert.Equals(t, 100, ls.LatestQuote.Amount) }, }, }