package ofxgo_test import ( "github.com/aclindsa/ofxgo" "testing" "time" ) func TestMarshalBankStatementRequest(t *testing.T) { var expectedString string = ` 20060115112300.000[-5:EST] myusername Pa$$word ENG BNK 1987 OFXGO 0001 123 318398732 78346129 CHECKING Y ` var client = ofxgo.Client{ AppId: "OFXGO", AppVer: "0001", SpecVersion: "203", } var request ofxgo.Request request.Signon.UserId = "myusername" request.Signon.UserPass = "Pa$$word" request.Signon.Org = "BNK" request.Signon.Fid = "1987" statementRequest := ofxgo.StatementRequest{ TrnUID: "123", BankAcctFrom: ofxgo.BankAcct{ BankId: "318398732", AcctId: "78346129", AcctType: "CHECKING", }, Include: true, } request.Banking = append(request.Banking, &statementRequest) request.SetClientFields(&client) // Overwrite the DtClient value set by SetClientFields to time.Now() EST := time.FixedZone("EST", -5*60*60) request.Signon.DtClient = ofxgo.Date(time.Date(2006, 1, 15, 11, 23, 0, 0, EST)) marshalCheckRequest(t, &request, expectedString) }