diff --git a/nuspec/nuget/Cake.CsvHelper.nuspec b/nuspec/nuget/Cake.CsvHelper.nuspec
index d781083..31b9b2e 100644
--- a/nuspec/nuget/Cake.CsvHelper.nuspec
+++ b/nuspec/nuget/Cake.CsvHelper.nuspec
@@ -12,13 +12,26 @@
https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png
false
Copyright (c) Radio Systems Corporation 2017 - Present
+ README.md
Cake, Script, Build, CsvHelper, CSV, Addin
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Cake.CsvHelper.Tests/Cake.CsvHelper.Tests.csproj b/src/Cake.CsvHelper.Tests/Cake.CsvHelper.Tests.csproj
index 3188e97..5fa80fe 100644
--- a/src/Cake.CsvHelper.Tests/Cake.CsvHelper.Tests.csproj
+++ b/src/Cake.CsvHelper.Tests/Cake.CsvHelper.Tests.csproj
@@ -1,157 +1,20 @@
-
-
-
-
+
- Debug
- AnyCPU
- {1691864A-29DA-4ED9-A2C1-3EE39D006F51}
- Library
- Properties
- Cake.CsvHelper.Tests
- Cake.CsvHelper.Tests
- v4.6.1
- 512
-
-
-
+ net8.0;net9.0
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- ..\packages\Cake.Core.0.23.0\lib\net46\Cake.Core.dll
-
-
- ..\packages\Cake.Testing.0.23.0\lib\net46\Cake.Testing.dll
-
-
- ..\packages\Castle.Core.4.2.1\lib\net45\Castle.Core.dll
-
-
- ..\packages\CsvHelper.6.0.0\lib\net45\CsvHelper.dll
-
-
- ..\packages\NSubstitute.3.1.0\lib\net46\NSubstitute.dll
-
-
- ..\packages\Should.1.1.20\lib\Should.dll
- True
-
-
-
-
-
-
- ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll
- True
-
-
- ..\packages\System.Net.Http.4.3.3\lib\net46\System.Net.Http.dll
-
-
-
- ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll
- True
-
-
- ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll
-
-
- ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll
-
-
- ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll
-
-
- ..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll
-
-
- ..\packages\System.Threading.Tasks.Extensions.4.4.0\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll
-
-
-
-
-
-
-
- ..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll
-
-
- ..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll
- True
-
-
- ..\packages\xunit.assert.2.3.1\lib\netstandard1.1\xunit.assert.dll
-
-
- ..\packages\xunit.extensibility.core.2.3.1\lib\netstandard1.1\xunit.core.dll
-
-
- ..\packages\xunit.extensibility.execution.2.3.1\lib\net452\xunit.execution.desktop.dll
-
-
-
-
-
-
-
-
- True
- True
- Resources.resx
-
-
-
-
- {85c3e531-f53b-4344-9456-1b0176e547da}
- Cake.CsvHelper
-
-
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
-
-
+
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
-
+
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Cake.CsvHelper.Tests/CsvHelperAliasesTests.cs b/src/Cake.CsvHelper.Tests/CsvHelperAliasesTests.cs
index 76bdd96..02f39b5 100644
--- a/src/Cake.CsvHelper.Tests/CsvHelperAliasesTests.cs
+++ b/src/Cake.CsvHelper.Tests/CsvHelperAliasesTests.cs
@@ -4,7 +4,7 @@
using Cake.Core.IO;
using Cake.CsvHelper.Tests.Fixtures;
using NSubstitute;
-using Should;
+using Shouldly;
using Xunit;
namespace Cake.CsvHelper.Tests {
@@ -19,7 +19,7 @@ public void Should_Throw_If_Context_Is_Null() {
var result = Record.Exception(() => CsvHelperAliases.ReadCsv(null, file.Path));
// Then
- result.ShouldBeType().ParamName.ShouldEqual("context");
+ result.ShouldBeOfType().ParamName.ShouldBe("context");
}
[Fact]
@@ -33,7 +33,7 @@ public void Should_Throw_If_CSV_File_Is_Null() {
var result = Record.Exception(() => CsvHelperAliases.ReadCsv(context, null));
// Then
- result.ShouldBeType().ParamName.ShouldEqual("csvFile");
+ result.ShouldBeOfType().ParamName.ShouldBe("csvFile");
}
}
@@ -47,7 +47,7 @@ public void Should_Throw_If_Context_Is_Null() {
var result = Record.Exception(() => CsvHelperAliases.WriteCsv(null, file.Path, new List()));
// Then
- result.ShouldBeType().ParamName.ShouldEqual("context");
+ result.ShouldBeOfType().ParamName.ShouldBe("context");
}
}
}
diff --git a/src/Cake.CsvHelper.Tests/CsvHelperTests.cs b/src/Cake.CsvHelper.Tests/CsvHelperTests.cs
index a3dc40b..e17e47c 100644
--- a/src/Cake.CsvHelper.Tests/CsvHelperTests.cs
+++ b/src/Cake.CsvHelper.Tests/CsvHelperTests.cs
@@ -4,9 +4,8 @@
using Cake.Core.IO;
using Cake.CsvHelper.Tests.Fixtures;
using Cake.CsvHelper.Tests.Properties;
-using Should;
+using Shouldly;
using Xunit;
-using Xunit.Sdk;
namespace Cake.CsvHelper.Tests {
public sealed class CsvHelperTests {
@@ -20,7 +19,7 @@ public void Should_Throw_If_CsvFile_Is_Null() {
var result = Record.Exception(() => fixture.Read());
// Then
- result.ShouldBeType().ParamName.ShouldEqual("csvFile");
+ result.ShouldBeOfType().ParamName.ShouldBe("csvFile");
}
[Fact]
@@ -33,7 +32,7 @@ public void Should_Throw_If_Settings_Are_Null() {
var result = Record.Exception(() => fixture.Read());
// Then
- result.ShouldBeType().ParamName.ShouldEqual("settings");
+ result.ShouldBeOfType().ParamName.ShouldBe("settings");
}
[Fact]
@@ -46,7 +45,7 @@ public void Should_Throw_If_File_Does_Not_Exist() {
var result = Record.Exception(() => fixture.Read());
// Then
- result.ShouldBeType();
+ result.ShouldBeOfType();
}
}
@@ -61,7 +60,7 @@ public void Should_Throw_If_CsvFile_Is_Null() {
var result = Record.Exception(() => fixture.WriteNoMapping());
// Then
- result.ShouldBeType().ParamName.ShouldEqual("csvFile");
+ result.ShouldBeOfType().ParamName.ShouldBe("csvFile");
}
[Fact]
@@ -73,7 +72,7 @@ public void Should_Throw_If_Records_Are_Null() {
var result = Record.Exception(() => fixture.WriteNoMapping());
// Then
- result.ShouldBeType().ParamName.ShouldEqual("records");
+ result.ShouldBeOfType().ParamName.ShouldBe("records");
}
[Fact]
@@ -86,7 +85,7 @@ public void Should_Throw_If_Settings_Are_Null() {
var result = Record.Exception(() => fixture.WriteNoMapping());
// Then
- result.ShouldBeType().ParamName.ShouldEqual("settings");
+ result.ShouldBeOfType().ParamName.ShouldBe("settings");
}
[Fact(Skip = "Experimental")]
@@ -99,12 +98,12 @@ public void Should_Write_Records_To_CsvFile_With_No_Map() {
// Then
var resultFile = fixture.FileSystem.GetFile(fixture.ResultPath);
- resultFile.Exists.ShouldEqual(true);
+ resultFile.Exists.ShouldBe(true);
string resultString;
using(var resultStream = resultFile.OpenRead())
using (var streamReader = new StreamReader(resultStream, Encoding.UTF8)) {
resultString = streamReader.ReadToEnd();
- resultString.Trim().ShouldEqual(Resources.CsvHelper_CsvFile.Trim());
+ resultString.Trim().ShouldBe(Resources.CsvHelper_CsvFile.Trim());
}
}
}
@@ -120,7 +119,7 @@ public void Should_Throw_If_CsvFile_Is_Null() {
var result = Record.Exception(() => fixture.WriteWithMapping());
// Then
- result.ShouldBeType().ParamName.ShouldEqual("csvFile");
+ result.ShouldBeOfType().ParamName.ShouldBe("csvFile");
}
[Fact]
@@ -132,7 +131,7 @@ public void Should_Throw_If_Records_Are_Null() {
var result = Record.Exception(() => fixture.WriteWithMapping());
// Then
- result.ShouldBeType().ParamName.ShouldEqual("records");
+ result.ShouldBeOfType().ParamName.ShouldBe("records");
}
[Fact]
@@ -144,7 +143,7 @@ public void Should_Throw_If_ClassMap_Is_Null() {
var result = Record.Exception(() => fixture.WriteWithMapping());
// Then
- result.ShouldBeType().ParamName.ShouldEqual("classMap");
+ result.ShouldBeOfType().ParamName.ShouldBe("classMap");
}
[Fact]
@@ -156,7 +155,7 @@ public void Should_Throw_If_Mapping_Is_Null() {
var result = Record.Exception(() => fixture.WriteWithMapping(true));
// Then
- result.ShouldBeType().ParamName.ShouldEqual("mapping");
+ result.ShouldBeOfType().ParamName.ShouldBe("mapping");
}
[Fact]
@@ -169,7 +168,7 @@ public void Should_Throw_If_Settings_Are_Null() {
var result = Record.Exception(() => fixture.WriteWithMapping());
// Then
- result.ShouldBeType().ParamName.ShouldEqual("settings");
+ result.ShouldBeOfType().ParamName.ShouldBe("settings");
}
[Fact(Skip = "Experimental")]
@@ -182,13 +181,13 @@ public void Should_Write_Records_To_CsvFile_With_Class_Map() {
// Then
var resultFile = fixture.FileSystem.GetFile(fixture.ResultPath);
- resultFile.Exists.ShouldEqual(true);
+ resultFile.Exists.ShouldBe(true);
string resultString;
using (var resultStream = resultFile.OpenRead())
using (var streamReader = new StreamReader(resultStream, Encoding.UTF8)) {
resultString = streamReader.ReadToEnd();
}
- resultString.Trim().ShouldEqual(Resources.CsvHelper_MappedFile.Trim());
+ resultString.Trim().ShouldBe(Resources.CsvHelper_MappedFile.Trim());
}
[Fact(Skip = "Experimental")]
@@ -201,13 +200,13 @@ public void Should_Write_Records_To_CsvFile_With_Dictionary_Map() {
// Then
var resultFile = fixture.FileSystem.GetFile(fixture.ResultPath);
- resultFile.Exists.ShouldEqual(true);
+ resultFile.Exists.ShouldBe(true);
string resultString;
using (var resultStream = resultFile.OpenRead())
using (var streamReader = new StreamReader(resultStream, Encoding.UTF8)) {
resultString = streamReader.ReadToEnd();
}
- resultString.Trim().ShouldEqual(Resources.CsvHelper_MappedFile.Trim());
+ resultString.Trim().ShouldBe(Resources.CsvHelper_MappedFile.Trim());
}
}
}
diff --git a/src/Cake.CsvHelper.Tests/Properties/AssemblyInfo.cs b/src/Cake.CsvHelper.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index cf8c6fd..0000000
--- a/src/Cake.CsvHelper.Tests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Cake.CsvHelper.Tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Cake.CsvHelper.Tests")]
-[assembly: AssemblyCopyright("Copyright © 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("1691864a-29da-4ed9-a2c1-3ee39d006f51")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/Cake.CsvHelper.Tests/app.config b/src/Cake.CsvHelper.Tests/app.config
deleted file mode 100644
index 7d8c922..0000000
--- a/src/Cake.CsvHelper.Tests/app.config
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Cake.CsvHelper.Tests/packages.config b/src/Cake.CsvHelper.Tests/packages.config
deleted file mode 100644
index ccf02bd..0000000
--- a/src/Cake.CsvHelper.Tests/packages.config
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Cake.CsvHelper.sln b/src/Cake.CsvHelper.sln
index c89d61d..a00da9c 100644
--- a/src/Cake.CsvHelper.sln
+++ b/src/Cake.CsvHelper.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
+# Visual Studio Version 17
+VisualStudioVersion = 17.14.36603.0 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.CsvHelper", "Cake.CsvHelper\Cake.CsvHelper.csproj", "{85C3E531-F53B-4344-9456-1B0176E547DA}"
EndProject
diff --git a/src/Cake.CsvHelper/Cake.CsvHelper.csproj b/src/Cake.CsvHelper/Cake.CsvHelper.csproj
index 1152c16..89cd5f1 100644
--- a/src/Cake.CsvHelper/Cake.CsvHelper.csproj
+++ b/src/Cake.CsvHelper/Cake.CsvHelper.csproj
@@ -1,68 +1,10 @@
-
-
-
+
- Debug
- AnyCPU
- {85C3E531-F53B-4344-9456-1B0176E547DA}
- Library
- Properties
- Cake.CsvHelper
- Cake.CsvHelper
- v4.6.1
- 512
-
+ net8.0;net9.0
+ Copyright © 2017-2025 Cake Contributors
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- bin\Debug\Cake.CsvHelper.XML
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- bin\Release\Cake.CsvHelper.XML
-
-
-
- ..\packages\Cake.Core.0.23.0\lib\net46\Cake.Core.dll
-
-
- ..\packages\CsvHelper.6.0.0\lib\net45\CsvHelper.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
\ No newline at end of file
diff --git a/src/Cake.CsvHelper/CsvHelpers.cs b/src/Cake.CsvHelper/CsvHelpers.cs
index cc066d1..071da9c 100644
--- a/src/Cake.CsvHelper/CsvHelpers.cs
+++ b/src/Cake.CsvHelper/CsvHelpers.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Globalization;
using System.IO;
using System.Linq;
using Cake.Core;
@@ -42,9 +43,9 @@ public IEnumerable ReadRecords(FilePath csvFile, ClassMap classMap, CsvHel
}
var file = GetFile(csvFile);
using (var textReader = new StreamReader(file.OpenRead()))
- using (var csvReader = new CsvReader(textReader)) {
+ using (var csvReader = new CsvReader(textReader, CultureInfo.InvariantCulture)) {
if (classMap != null) {
- csvReader.Configuration.RegisterClassMap(classMap);
+ csvReader.Context.RegisterClassMap(classMap);
}
return csvReader.GetRecords().ToList();
}
@@ -75,8 +76,8 @@ public void WriteRecords(FilePath csvFile, List records, ClassMap classMap
var file = GetFile(csvFile);
using (var stream = file.OpenWrite())
using (var textWriter = new StreamWriter(stream, settings.Encoding))
- using (var csvWriter = new CsvWriter(textWriter)) {
- csvWriter.Configuration.RegisterClassMap(classMap);
+ using (var csvWriter = new CsvWriter(textWriter, CultureInfo.InvariantCulture)) {
+ csvWriter.Context.RegisterClassMap(classMap);
csvWriter.WriteHeader();
foreach (var record in records) {
csvWriter.WriteRecord(record);
@@ -99,7 +100,7 @@ public void WriteRecords(FilePath csvFile, List records, Dictionary();
- customMap.AutoMap();
+ customMap.AutoMap(CultureInfo.InvariantCulture);
WriteRecords(csvFile, records, customMap, settings);
}
@@ -125,7 +126,7 @@ public void WriteRecords(FilePath csvFile, List records, CsvHelperSettings
var file = GetFile(csvFile);
using (var stream = file.OpenWrite())
using (var textWriter = new StreamWriter(stream, settings.Encoding))
- using (var csvWriter = new CsvWriter(textWriter)) {
+ using (var csvWriter = new CsvWriter(textWriter, CultureInfo.InvariantCulture)) {
csvWriter.WriteHeader();
foreach (var record in records) {
csvWriter.WriteRecord(record);
diff --git a/src/Cake.CsvHelper/Properties/AssemblyInfo.cs b/src/Cake.CsvHelper/Properties/AssemblyInfo.cs
deleted file mode 100644
index 123232e..0000000
--- a/src/Cake.CsvHelper/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Cake.CsvHelper")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Cake.CsvHelper")]
-[assembly: AssemblyCopyright("Copyright © 2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("85c3e531-f53b-4344-9456-1b0176e547da")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/src/Cake.CsvHelper/packages.config b/src/Cake.CsvHelper/packages.config
deleted file mode 100644
index 4772a52..0000000
--- a/src/Cake.CsvHelper/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file