Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded to .NET Core 2.0 / .NET Standard 2.0 #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,7 @@ pip-log.txt

#Mr Developer
.mr.developer.cfg
/.vs/LINQtoCSV/v15/Server/sqlite3/storage.ide-wal
/.vs/LINQtoCSV/v15/Server/sqlite3/storage.ide-shm
/.vs/LINQtoCSV/v15/Server/sqlite3/storage.ide
/.vs/LINQtoCSV/v15/Server/sqlite3/db.lock
26 changes: 11 additions & 15 deletions LINQtoCSV.Tests/CsvContextReadTests.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using LINQtoCSV;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.IO;
using System.Collections.Generic;
using System;
using Xunit;

namespace LINQtoCSV.Tests
{
[TestClass()]
public class CsvContextReadTests : Test
{
[TestMethod()]
[Fact]
public void GoodFileUsingOutputFormatForParsingDatesCharUSEnglish()
{
// Arrange
Expand Down Expand Up @@ -45,7 +41,7 @@ public void GoodFileUsingOutputFormatForParsingDatesCharUSEnglish()
AssertRead(testInput, fileDescription_namesUs, expected);
}

[TestMethod()]
[Fact]
public void GoodFileNoSeparatorCharUseOutputFormatForParsingUSEnglish()
{
// Arrange
Expand Down Expand Up @@ -81,7 +77,7 @@ public void GoodFileNoSeparatorCharUseOutputFormatForParsingUSEnglish()
AssertRead(testInput, fileDescription_namesUs, expected);
}

[TestMethod()]
[Fact]
public void GoodFileNoSeparatorCharUSEnglish()
{
// Arrange
Expand Down Expand Up @@ -117,7 +113,7 @@ public void GoodFileNoSeparatorCharUSEnglish()
AssertRead(testInput, fileDescription_namesUs, expected);
}

[TestMethod()]
[Fact]
public void GoodFileCommaDelimitedUseFieldIndexForReadingDataCharUSEnglish()
{
// Arrange
Expand Down Expand Up @@ -154,7 +150,7 @@ public void GoodFileCommaDelimitedUseFieldIndexForReadingDataCharUSEnglish()
AssertRead(testInput, fileDescription_namesUs, expected);
}

[TestMethod()]
[Fact]
public void GoodFileCommaDelimitedUseFieldIndexForReadingDataCharUseOutputFormatForParsingUSEnglish()
{
// Arrange
Expand Down Expand Up @@ -194,7 +190,7 @@ public void GoodFileCommaDelimitedUseFieldIndexForReadingDataCharUseOutputFormat
}


[TestMethod()]
[Fact]
public void GoodFileCommaDelimitedNamesInFirstLineUSEnglish()
{
// Arrange
Expand Down Expand Up @@ -242,7 +238,7 @@ and a quoted ""string"""
AssertRead(testInput, fileDescription_namesUs, expected);
}

[TestMethod()]
[Fact]
public void GoodFileTabDelimitedNoNamesInFirstLineNLnl()
{
// Arrange
Expand Down Expand Up @@ -283,7 +279,7 @@ and a quoted ""string"""
AssertRead(testInput, fileDescription_nonamesNl, expected);
}

[TestMethod()]
[Fact]
public void GoodFileCommaDelimitedWithTrailingSeparatorChars()
{
// Arrange
Expand Down Expand Up @@ -332,7 +328,7 @@ and a quoted ""string"""
AssertRead(testInput, fileDescription_namesUs, expected);
}

[TestMethod()]
[Fact]
public void FileWithUnknownColumns_ShouldDiscardColumns() {
var description = new CsvFileDescription
{
Expand Down
9 changes: 3 additions & 6 deletions LINQtoCSV.Tests/CsvContextWriteTests.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
using LINQtoCSV;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.IO;
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;

namespace LINQtoCSV.Tests
{
[TestClass()]
public class CsvContextWriteTests : Test
{
[TestMethod()]
[Fact]
public void GoodFileCommaDelimitedNamesInFirstLineNLnl()
{
// Arrange
Expand Down
7 changes: 1 addition & 6 deletions LINQtoCSV.Tests/IAssertable.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LINQtoCSV.Tests
namespace LINQtoCSV.Tests
{
public interface IAssertable<T>
{
Expand Down
87 changes: 16 additions & 71 deletions LINQtoCSV.Tests/LINQtoCSV.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,79 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{04EE17CD-E7B3-4D58-BF84-E553F5332A14}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LINQtoCSV.Tests</RootNamespace>
<AssemblyName>LINQtoCSV.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFramework>netcoreapp2.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>

<ItemGroup>
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
<Visible>False</Visible>
</CodeAnalysisDependentAssemblyPaths>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

<ItemGroup>
<Compile Include="CsvContextWriteTests.cs" />
<Compile Include="CsvContextReadTests.cs" />
<Compile Include="IAssertable.cs" />
<Compile Include="Person.cs" />
<Compile Include="ProductDataSpecificFieldIndex.cs" />
<Compile Include="ProductData.cs" />
<Compile Include="ProductData_DuplicateIndices.cs" />
<Compile Include="ProductData_MissingFieldIndex.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Test.cs" />
<Compile Include="TestDataRow.cs" />
<Compile Include="Utils.cs" />
<ProjectReference Include="..\LINQtoCSV\LINQtoCSV.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LINQtoCSV\LINQtoCSV.csproj">
<Project>{07058BF9-6F86-40FF-AE33-2A4F89B5758A}</Project>
<Name>LINQtoCSV</Name>
</ProjectReference>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
12 changes: 4 additions & 8 deletions LINQtoCSV.Tests/Person.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;

namespace LINQtoCSV.Tests
{
Expand All @@ -15,9 +11,9 @@ public class Person : IAssertable<Person> {
public int Age { get; set; }

public void AssertEqual(Person other) {
Assert.AreEqual(other.Name, Name);
Assert.AreEqual(other.LastName, LastName);
Assert.AreEqual(other.Age, Age);
Assert.Equal(other.Name, Name);
Assert.Equal(other.LastName, LastName);
Assert.Equal(other.Age, Age);
}
}
}
32 changes: 14 additions & 18 deletions LINQtoCSV.Tests/ProductData.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization;
using LINQtoCSV;
using Xunit;

namespace LINQtoCSV.Tests
{
// Because the fields in this type are used only indirectly, the compiler
// will warn they are unused or unassigned. Disable those warnings.
// Because the fields in this type are used only indirectly, the compiler
// will warn they are unused or unassigned. Disable those warnings.
#pragma warning disable 0169, 0414, 0649

internal class ProductData : IAssertable<ProductData>
Expand Down Expand Up @@ -62,18 +58,18 @@ internal class ProductData : IAssertable<ProductData>

public void AssertEqual(ProductData other)
{
Assert.AreNotEqual(other, null);
Assert.NotNull(other);

Assert.AreEqual(other.name, name, "name");
Assert.AreEqual(other.startDate, startDate, "startDate");
Assert.AreEqual(other.launchTime, launchTime, "launchTime");
Assert.AreEqual(other.weight, weight, "weight");
Assert.AreEqual(other.nbrAvailable, nbrAvailable, "nbrAvailable");
Assert.AreEqual(other.shopsAvailable, shopsAvailable, "shopsAvailable");
Assert.AreEqual(other.hexProductCode, hexProductCode, "hexProductCode");
Assert.AreEqual(other.onsale, onsale, "onsale");
Assert.AreEqual(other.retailPrice, retailPrice, "retailPrice");
Assert.AreEqual(Utils.NormalizeString(other.description), Utils.NormalizeString(description), "description");
Assert.Equal(other.name, name);
Assert.Equal(other.startDate, startDate);
Assert.Equal(other.launchTime, launchTime);
Assert.Equal(other.weight, weight);
Assert.Equal(other.nbrAvailable, nbrAvailable);
Assert.Equal(other.shopsAvailable, shopsAvailable);
Assert.Equal(other.hexProductCode, hexProductCode);
Assert.Equal(other.onsale, onsale);
Assert.Equal(other.retailPrice, retailPrice);
Assert.Equal(Utils.NormalizeString(other.description), Utils.NormalizeString(description));
}
}
}
33 changes: 14 additions & 19 deletions LINQtoCSV.Tests/ProductDataSpecificFieldIndex.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization;
using LINQtoCSV;
using Xunit;

namespace LINQtoCSV.Tests
{
// Because the fields in this type are used only indirectly, the compiler
// will warn they are unused or unassigned. Disable those warnings.
// Because the fields in this type are used only indirectly, the compiler
// will warn they are unused or unassigned. Disable those warnings.
#pragma warning disable 0169, 0414, 0649

internal class ProductDataSpecificFieldIndex : IAssertable<ProductDataSpecificFieldIndex>
Expand All @@ -29,11 +24,11 @@ internal class ProductDataSpecificFieldIndex : IAssertable<ProductDataSpecificFi

public void AssertEqual(ProductDataSpecificFieldIndex other)
{
Assert.AreNotEqual(other, null);
Assert.NotNull(other);

Assert.AreEqual(other.name, name, "name");
Assert.AreEqual(other.startDate, startDate, "startDate");
Assert.AreEqual(other.weight, weight, "weight");
Assert.Equal(other.name, name);
Assert.Equal(other.startDate, startDate);
Assert.Equal(other.weight, weight);
}
}

Expand All @@ -54,11 +49,11 @@ internal class ProductDataCharLength : IAssertable<ProductDataCharLength>

public void AssertEqual(ProductDataCharLength other)
{
Assert.AreNotEqual(other, null);
Assert.NotNull(other);

Assert.AreEqual(other.name, name, "name");
Assert.AreEqual(other.startDate, startDate, "startDate");
Assert.AreEqual(other.weight, weight, "weight");
Assert.Equal(other.name, name);
Assert.Equal(other.startDate, startDate);
Assert.Equal(other.weight, weight);
}
}

Expand All @@ -75,10 +70,10 @@ internal class ProductDataParsingOutputFormat : IAssertable<ProductDataParsingOu

public void AssertEqual(ProductDataParsingOutputFormat other)
{
Assert.AreNotEqual(other, null);
Assert.NotNull(other);

Assert.AreEqual(other.name, name, "name");
Assert.AreEqual(other.startDate, startDate, "startDate");
Assert.Equal(other.name, name);
Assert.Equal(other.startDate, startDate);
}
}
}
10 changes: 2 additions & 8 deletions LINQtoCSV.Tests/ProductData_DuplicateIndices.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Globalization;
using LINQtoCSV;

namespace LINQtoCSV.Tests
{
// Because the fields in this type are used only indirectly, the compiler
// will warn they are unused or unassigned. Disable those warnings.
// Because the fields in this type are used only indirectly, the compiler
// will warn they are unused or unassigned. Disable those warnings.
#pragma warning disable 0169, 0414, 0649

class ProductData_DuplicateIndices
Expand Down
10 changes: 2 additions & 8 deletions LINQtoCSV.Tests/ProductData_MissingFieldIndex.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Globalization;
using LINQtoCSV;

namespace LINQtoCSV.Tests
{
// Because the fields in this type are used only indirectly, the compiler
// will warn they are unused or unassigned. Disable those warnings.
// Because the fields in this type are used only indirectly, the compiler
// will warn they are unused or unassigned. Disable those warnings.
#pragma warning disable 0169, 0414, 0649

class ProductData_MissingFieldIndex
Expand Down
Loading