Documentation
¶
Overview ¶
Package tests provides helpers for testing.
Index ¶
- func LogRecords(t *testing.T, recs []*pb.Record)
- func NewBalance(t *testing.T, y int, m time.Month, cash int64, pp ...fin.Position) fin.Balance
- func NewPosition(t *testing.T, inv, div int64) fin.Position
- func NewRecord(t *testing.T, y int32, m time.Month, sp, div, earn, cpi int32) *pb.Record
- func NewTime(t *testing.T, year int, month time.Month) time.Time
- type InfoStringer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogRecords ¶
LogRecords testing helper logs market records, one per line.
func NewBalance ¶
NewBalance testing helper creates a fin.Balance with year, month, cash, and optional positions.
func NewPosition ¶
NewPosition testing helper creates a fin.Position with investments and dividend.
Types ¶
type InfoStringer ¶
type InfoStringer report.StrategyInfo
InfoStringer makes report.StrategyInfo printable for tests.
func (InfoStringer) String ¶
func (info InfoStringer) String() string
String implements fmt.Stringer interface.
Click to show internal directories.
Click to hide internal directories.