Beispiel #1
0
        public async Task <FileInfo> GenerateFileAsync(string path, long fileSize,
                                                       IProgressReporter progressReporter)
        {
            await FileSystemHelper.CreateEmptyFileAsync(path, true);

            var writeItemsTask = WriteItemsToFileAsync(path, progressReporter, fileSize);
            await Task.WhenAll(writeItemsTask);

            return(new FileInfo(path));
        }
        public static async Task <string> CreateFile(string fileName, string data)
        {
            var executionDirectory = Path.GetDirectoryName(typeof(IntegrationTest).Assembly.Location);
            var dataPath           = Path.Combine(executionDirectory, "IntegrationTest");

            FileSystemHelper.DeleteDirectory(dataPath);
            var inputFilePath = Path.Combine(dataPath, fileName);
            await FileSystemHelper.CreateEmptyFileAsync(inputFilePath, true);

            await File.WriteAllTextAsync(inputFilePath, data);

            return(inputFilePath);
        }