Skip to content

Commit

Permalink
Package securities/quote also tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Jan 1, 2025
1 parent ac24063 commit 3bdf433
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion securities/quote/quote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
},
},
}
Expand Down

0 comments on commit 3bdf433

Please sign in to comment.