private async Task TestSaveAsCsvSuccess(bool includeHeaders)
        {
            await this.RunFileSaveTest(async (filePath) =>
            {
                // Given: 
                // ... A simple data set that requires 1 message
                SerializeDataStartRequestParams saveParams = new SerializeDataStartRequestParams()
                {
                    FilePath = filePath,
                    Columns = DefaultColumns,
                    Rows = DefaultData,
                    IsLastBatch = true,
                    SaveFormat = "csv",
                    IncludeHeaders = includeHeaders
                };
                // When: I attempt to save this to a file
                var efv = new EventFlowValidator<SerializeDataResult>()
                    .AddStandardResultValidator()
                    .Complete();

                await SerializationService.RunSerializeStartRequest(saveParams, efv.Object);

                // Then:
                // ... There should not have been an error
                efv.Validate();
                // ... And the file should look as expected
                VerifyContents.VerifyCsvMatchesData(saveParams.Rows, saveParams.Columns, saveParams.IncludeHeaders, saveParams.FilePath);
            });
        }
 private async Task SaveAsXmlMultiRequestSuccess()
 {
     Action<SerializeDataStartRequestParams> setParams = (serializeParams) => {
         serializeParams.SaveFormat = "xml";
     };
     Action<string> validation = (filePath) => {
         VerifyContents.VerifyXmlMatchesData(DefaultData, DefaultColumns, filePath);
     };
     await this.TestSerializeDataMultiRequestSuccess(setParams, validation);
 }
 private async Task TestSaveAsCsvMultiRequestSuccess(bool includeHeaders)
 {
     Action<SerializeDataStartRequestParams> setParams = (serializeParams) => {
         serializeParams.SaveFormat = "csv";
         serializeParams.IncludeHeaders = includeHeaders;
     };
     Action<string> validation = (filePath) => {
         VerifyContents.VerifyCsvMatchesData(DefaultData, DefaultColumns, includeHeaders, filePath);
     };
     await this.TestSerializeDataMultiRequestSuccess(setParams, validation);
 }