lytics / ios-sdk

MIT License
0 stars 0 forks source link

Upload Request Builder and Tests #18

Closed mgacy closed 1 year ago

mgacy commented 1 year ago

This provides a live implementation of DataUploadRequestBuilder, stubs Uploader, and adds tests for EventQueue and DataUploadRequestBuilder.

DataUploadRequestBuilder is responsible for encoding events destined for different event streams and creating the corresponding requests. JSONEncoder cannot encode an array of existentials so we have to manage the data manually and iterate over each element, encode the opened StreamEvent, and add that to the encoded data. The rather tedious tests in DataUploadRequestBuilderTests are to ensure that this process is correct.