Skip to content

Migrate to *.csproj. Support net4.5 #1

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

Merged
merged 2 commits into from
Apr 26, 2017
Merged
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
26 changes: 17 additions & 9 deletions Unidecode.NET.sln
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{604AAA61-6C9C-4421-9DA5-0805968113A8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C9018F64-4917-4F4F-8F78-3A674896029D}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
readme.md = readme.md
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Unidecode.NET", "src\Unidecode.NET\Unidecode.NET.xproj", "{A1A9B022-442C-4782-AF37-F8E58E5740A3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unidecode.NET", "src\Unidecode.NET.csproj", "{3ED46251-F3F1-43F0-8776-A5055D96BB56}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{8F8EB995-97FD-41CD-B307-E2F8E987C468}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unidecode.NET.Tests", "test\Unidecode.NET.Tests.csproj", "{C93F3F13-BFB7-4440-BC52-B1BFAC74EB1B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A1A9B022-442C-4782-AF37-F8E58E5740A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1A9B022-442C-4782-AF37-F8E58E5740A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1A9B022-442C-4782-AF37-F8E58E5740A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1A9B022-442C-4782-AF37-F8E58E5740A3}.Release|Any CPU.Build.0 = Release|Any CPU
{3ED46251-F3F1-43F0-8776-A5055D96BB56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3ED46251-F3F1-43F0-8776-A5055D96BB56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3ED46251-F3F1-43F0-8776-A5055D96BB56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3ED46251-F3F1-43F0-8776-A5055D96BB56}.Release|Any CPU.Build.0 = Release|Any CPU
{C93F3F13-BFB7-4440-BC52-B1BFAC74EB1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C93F3F13-BFB7-4440-BC52-B1BFAC74EB1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C93F3F13-BFB7-4440-BC52-B1BFAC74EB1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C93F3F13-BFB7-4440-BC52-B1BFAC74EB1B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A1A9B022-442C-4782-AF37-F8E58E5740A3} = {604AAA61-6C9C-4421-9DA5-0805968113A8}
{3ED46251-F3F1-43F0-8776-A5055D96BB56} = {604AAA61-6C9C-4421-9DA5-0805968113A8}
{C93F3F13-BFB7-4440-BC52-B1BFAC74EB1B} = {8F8EB995-97FD-41CD-B307-E2F8E987C468}
EndGlobalSection
EndGlobal
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

18 changes: 18 additions & 0 deletions src/Unidecode.NET.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
<PackageId>Unidecode.NET</PackageId>
<VersionPrefix>1.1.0</VersionPrefix>
<AssemblyName>Unidecode.NET</AssemblyName>
<PackageId>Unidecode.NET</PackageId>
<PackageTags>text;unicode;seo</PackageTags>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/thecoderok/Unidecode.NET</RepositoryUrl>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
</PropertyGroup>
</Project>
19 changes: 0 additions & 19 deletions src/Unidecode.NET/Properties/AssemblyInfo.cs

This file was deleted.

21 changes: 0 additions & 21 deletions src/Unidecode.NET/Unidecode.NET.xproj

This file was deleted.

18 changes: 0 additions & 18 deletions src/Unidecode.NET/project.json

This file was deleted.

File renamed without changes.
21 changes: 21 additions & 0 deletions test/Unidecode.NET.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\Unidecode.NET.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
76 changes: 76 additions & 0 deletions test/UnidecoderTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
using System;
using System.Text;
using Xunit;

namespace Unidecode.NET.Tests
{
public class UnidecoderTest
{
[Fact]
public void DocTest()
{
Assert.Equal("Bei Jing ", "\u5317\u4EB0".Unidecode());
}

[Fact]
public void CustomTest()
{
Assert.Equal("Rabota s kirillitsey", "Работа с кириллицей".Unidecode());
Assert.Equal("aouoAOUO", "äöűőÄÖŨŐ".Unidecode());
}

[Fact]
public void PythonTest()
{
Assert.Equal("Hello, World!", "Hello, World!".Unidecode());

Assert.Equal("'\"\r\n", "'\"\r\n".Unidecode());
Assert.Equal("CZSczs", "ČŽŠčžš".Unidecode());
Assert.Equal("a", "ア".Unidecode());
Assert.Equal("a", "α".Unidecode());
Assert.Equal("a", "а".Unidecode());
Assert.Equal("chateau", "ch\u00e2teau".Unidecode());
Assert.Equal("vinedos", "vi\u00f1edos".Unidecode());
}

/// <summary>
/// According to http://en.wikipedia.org/wiki/Romanization_of_Russian BGN/PCGN.
/// http://en.wikipedia.org/wiki/BGN/PCGN_romanization_of_Russian
/// With converting "ё" to "yo".
/// </summary>
[Fact]
public void RussianAlphabetTest()
{
string russianAlphabetLowercase = "а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я";
string russianAlphabetUppercase = "А Б В Г Д Е Ё Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я";

string expectedLowercase = "a b v g d e yo zh z i y k l m n o p r s t u f kh ts ch sh shch \" y ' e yu ya";
string expectedUppercase = "A B V G D E Yo Zh Z I Y K L M N O P R S T U F Kh Ts Ch Sh Shch \" Y ' E Yu Ya";

Assert.Equal(expectedLowercase, russianAlphabetLowercase.Unidecode());
Assert.Equal(expectedUppercase, russianAlphabetUppercase.Unidecode());
}

[Fact]
public void CharUnidecodeTest()
{
string input = "а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я А Б В Г Д Е Ё Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я";
string expected = "a b v g d e yo zh z i y k l m n o p r s t u f kh ts ch sh shch \" y ' e yu ya A B V G D E Yo Zh Z I Y K L M N O P R S T U F Kh Ts Ch Sh Shch \" Y ' E Yu Ya";

var sb = new StringBuilder(expected.Length);
foreach (char c in input)
{
sb.Append(c.Unidecode());
}
string result = sb.ToString();

Assert.Equal(expected, result);
}

[Fact]
public void UnidecodeOnNullShouldReturnEmptyString()
{
Assert.Equal("", ((string)null).Unidecode());
}
}
}