Skip to content

Commit

Permalink
PR review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RikuVirtanen committed Nov 29, 2023
1 parent 28b72ff commit ad55aa5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
32 changes: 11 additions & 21 deletions Frends.CSV.Parse/Frends.CSV.Parse.Tests/UnitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,27 +271,17 @@ public void TestParseTreatMissingFieldsAsNullSetToTrueNoHeaderWithColumnSpecific
TreatMissingFieldsAsNulls = true
};

// The boxed type cannot be checked against Nullable<T> so to make sure no exception gets
// thrown when TreatMissingFieldsAsNulls is set to true have to check if exception is thrown
// when trying to insert empty values in the data
try
{
var result = CSV.Parse(input, options, default);
var resultData = result.Data;
var itemArray = resultData[1];

Assert.IsNull(itemArray[1]);
Assert.IsNull(itemArray[2]);
Assert.IsNull(itemArray[3]);
Assert.IsNull(itemArray[4]);
Assert.IsNull(itemArray[5]);
Assert.IsNull(itemArray[6]);
Assert.IsNull(itemArray[7]);
}
catch (Exception)
{
Assert.Fail("Should not throw an exception");
}
var result = CSV.Parse(input, options, default);
var resultData = result.Data;
var itemArray = resultData[1];

Assert.IsNull(itemArray[1]);
Assert.IsNull(itemArray[2]);
Assert.IsNull(itemArray[3]);
Assert.IsNull(itemArray[4]);
Assert.IsNull(itemArray[5]);
Assert.IsNull(itemArray[6]);
Assert.IsNull(itemArray[7]);
}

[TestMethod]
Expand Down
2 changes: 1 addition & 1 deletion Frends.CSV.Parse/Frends.CSV.Parse/Frends.CSV.Parse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>Frends Task for parsing CSV string.</Description>
<PackageProjectUrl>https://frends.com/</PackageProjectUrl>
<RepositoryUrl>https://github.com/FrendsPlatform/Frends.CSV</RepositoryUrl>
<RepositoryUrl>https://github.com/FrendsPlatform/Frends.CSV2/tree/main/Frends.CSV.Parse</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit ad55aa5

Please sign in to comment.