From 88bfe966246aa4baa34bfd87c8064fae4d9a5719 Mon Sep 17 00:00:00 2001 From: Leandro Fernandes Vieira Date: Mon, 16 Oct 2023 21:46:56 -0300 Subject: [PATCH] minor adjusts --- .../VariableLengthWriterBenchmark.cs | 2 -- RecordParser.Test/FileWriterTest.cs | 14 +++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/RecordParser.Benchmark/VariableLengthWriterBenchmark.cs b/RecordParser.Benchmark/VariableLengthWriterBenchmark.cs index 35d0b23..7be0b4f 100644 --- a/RecordParser.Benchmark/VariableLengthWriterBenchmark.cs +++ b/RecordParser.Benchmark/VariableLengthWriterBenchmark.cs @@ -8,11 +8,9 @@ using RecordParser.Extensions.FileWriter; using SoftCircuits.CsvParser; using System; -using System.Buffers; using System.Collections.Generic; using System.Globalization; using System.IO; -using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; diff --git a/RecordParser.Test/FileWriterTest.cs b/RecordParser.Test/FileWriterTest.cs index 3396931..efd5daf 100644 --- a/RecordParser.Test/FileWriterTest.cs +++ b/RecordParser.Test/FileWriterTest.cs @@ -32,7 +32,7 @@ public static IEnumerable Repeats() } } - // the fixed-length file scenario is already covered in the bellow test, + // the fixed-length file scenario is already covered in the test bellow, // because "WriteRecords" method dont matters what parser is used, // since it just receives a delegate [Theory] @@ -71,14 +71,14 @@ public void Write_csv_file(int repeat, bool parallel, bool ordered) using var memory = new MemoryStream(); using var textWriter = new StreamWriter(memory); - var writeOptions = new ParallelismOptions() + var parallelOptions = new ParallelismOptions() { Enabled = parallel, EnsureOriginalOrdering = ordered, MaxDegreeOfParallelism = MaxParallelism, }; - textWriter.WriteRecords(expectedItems, writer.TryFormat, writeOptions); + textWriter.WriteRecords(expectedItems, writer.TryFormat, parallelOptions); textWriter.Flush(); // Assert @@ -87,15 +87,15 @@ public void Write_csv_file(int repeat, bool parallel, bool ordered) using var textReader = new StreamReader(memory); var readOptions = new VariableLengthReaderOptions() { - ParallelismOptions = writeOptions + ParallelismOptions = parallelOptions }; - var reads = textReader.ReadRecords(reader, readOptions); + var items = textReader.ReadRecords(reader, readOptions); if (ordered) - reads.Should().BeEquivalentTo(expectedItems, cfg => cfg.WithStrictOrdering()); + items.Should().BeEquivalentTo(expectedItems, cfg => cfg.WithStrictOrdering()); else - reads.Should().BeEquivalentTo(expectedItems); + items.Should().BeEquivalentTo(expectedItems); } } } \ No newline at end of file