github.com/polygon-io/client-go@v1.16.4/rest/models/quotes_test.go (about) 1 package models_test 2 3 import ( 4 "testing" 5 "time" 6 7 "github.com/polygon-io/client-go/rest/models" 8 ) 9 10 func TestListQuotesParams(t *testing.T) { 11 timestamp := models.Nanos(time.Date(2023, 3, 23, 0, 0, 0, 0, time.UTC)) 12 order := models.Asc 13 limit := 100 14 sort := models.Timestamp 15 16 expect := models.ListQuotesParams{ 17 TimestampEQ: ×tamp, 18 TimestampLT: ×tamp, 19 TimestampLTE: ×tamp, 20 TimestampGT: ×tamp, 21 TimestampGTE: ×tamp, 22 Order: &order, 23 Limit: &limit, 24 Sort: &sort, 25 } 26 actual := models.ListQuotesParams{}. 27 WithTimestamp(models.EQ, timestamp). 28 WithTimestamp(models.LT, timestamp). 29 WithTimestamp(models.LTE, timestamp). 30 WithTimestamp(models.GT, timestamp). 31 WithTimestamp(models.GTE, timestamp). 32 WithOrder(order). 33 WithLimit(limit). 34 WithSort(sort) 35 36 checkParams(t, expect, *actual) 37 }