コード例 #1
0
        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);
            });
        }
コード例 #2
0
 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);
 }