github.com/polygon-io/client-go@v1.16.4/rest/models/conditions_test.go (about)

     1  package models_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/polygon-io/client-go/rest/models"
     7  )
     8  
     9  func TestListConditionsParams(t *testing.T) {
    10  	assetClass := models.AssetStocks
    11  	dataType := models.DataTrade
    12  	id := int64(1)
    13  	sip := models.CTA
    14  	order := models.Asc
    15  	limit := 20
    16  	sort := models.Name
    17  
    18  	expect := models.ListConditionsParams{
    19  		AssetClass: &assetClass,
    20  		DataType:   &dataType,
    21  		ID:         &id,
    22  		SIP:        &sip,
    23  		Order:      &order,
    24  		Limit:      &limit,
    25  		Sort:       &sort,
    26  	}
    27  	actual := models.ListConditionsParams{}.
    28  		WithAssetClass(assetClass).
    29  		WithDataType(dataType).
    30  		WithID(id).
    31  		WithSIP(sip).
    32  		WithOrder(order).
    33  		WithLimit(limit).
    34  		WithSort(sort)
    35  	checkParams(t, expect, *actual)
    36  }