Skip to content

Commit 161c22d

Browse files
committed
Added unit tests and fixed .net 5 issue
1 parent 422da13 commit 161c22d

File tree

19 files changed

+56
-5
lines changed

19 files changed

+56
-5
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0</TargetFramework>
5+
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
11+
<PackageReference Include="xunit" Version="2.4.0" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
13+
<PackageReference Include="coverlet.collector" Version="1.2.0" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\NetJSON.Net5_0\NetJSON.Net5_0.csproj" />
18+
</ItemGroup>
19+
20+
</Project>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Xunit;
4+
5+
namespace NetJSON.Net5_0.Tests
6+
{
7+
public class NetJSONTest
8+
{
9+
[Fact]
10+
public void Test1()
11+
{
12+
var jsonString = "{\"All\":{\"ym\":\"ss\"},\"ervicesAuto\":{\"ym\":\"ss\"},\"ocessor\":{\"\":\"ss\"},\"sonalDevice\":{\"\":\"ss\"},\"rryCan\":{\"\":\"ss\"},\"licom\":{\"ymr\":\"ss\"}}";
13+
var result = NetJSON.Deserialize<Dictionary<string, Dictionary<string, string>>>(jsonString);
14+
Assert.True(result.ContainsKey("All") && result["All"].ContainsKey("ym") && result["All"]["ym"].Equals("ss"));
15+
}
16+
}
17+
}

NetJSON.sln

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.27004.2009
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30717.126
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetJSON", "NetJSON\NetJSON.csproj", "{1308D326-02BB-45BD-8549-18F78A81F204}"
77
ProjectSection(ProjectDependencies) = postProject
@@ -30,6 +30,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetJSON.TestHarness", "NetJ
3030
EndProject
3131
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetJSON.Net5_0", "NetJSON.Net5_0\NetJSON.Net5_0.csproj", "{49CFDAC0-D244-4112-A56B-B457E02C76C5}"
3232
EndProject
33+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetJSON.Net5_0.Tests", "NetJSON.Net5_0.Tests\NetJSON.Net5_0.Tests.csproj", "{593B2B1F-212A-4F4D-853F-38FCA864AE33}"
34+
EndProject
3335
Global
3436
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3537
Debug|Any CPU = Debug|Any CPU
@@ -172,6 +174,18 @@ Global
172174
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.NetFX-Release|Any CPU.Build.0 = Release|Any CPU
173175
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
174176
{49CFDAC0-D244-4112-A56B-B457E02C76C5}.Release|Any CPU.Build.0 = Release|Any CPU
177+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
178+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.Debug|Any CPU.Build.0 = Debug|Any CPU
179+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.NetCore-Debug|Any CPU.ActiveCfg = Debug|Any CPU
180+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.NetCore-Debug|Any CPU.Build.0 = Debug|Any CPU
181+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.NetCore-Release|Any CPU.ActiveCfg = Release|Any CPU
182+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.NetCore-Release|Any CPU.Build.0 = Release|Any CPU
183+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.NetFX-Debug|Any CPU.ActiveCfg = Debug|Any CPU
184+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.NetFX-Debug|Any CPU.Build.0 = Debug|Any CPU
185+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.NetFX-Release|Any CPU.ActiveCfg = Release|Any CPU
186+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.NetFX-Release|Any CPU.Build.0 = Release|Any CPU
187+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.Release|Any CPU.ActiveCfg = Release|Any CPU
188+
{593B2B1F-212A-4F4D-853F-38FCA864AE33}.Release|Any CPU.Build.0 = Release|Any CPU
175189
EndGlobalSection
176190
GlobalSection(SolutionProperties) = preSolution
177191
HideSolutionNode = FALSE

NetJSON/NetJSON.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<id>NetJSON</id>
55
<title>NetJSON</title>
66
<tags>json json-serializer javascript JSON serializer binary</tags>
7-
<version>1.3.6</version>
7+
<version>1.3.7</version>
88
<authors>TJ Bakre</authors>
99
<description>Faster than Any Binary?</description>
1010
<releaseNotes>

NetJSON/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
// You can specify all the values or you can default the Build and Revision Numbers
3434
// by using the '*' as shown below:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("1.3.6")]
37-
[assembly: AssemblyFileVersion("1.3.6")]
36+
[assembly: AssemblyVersion("1.3.7")]
37+
[assembly: AssemblyFileVersion("1.3.7")]
3838
#if !NET_35 && !NET_STANDARD
3939
[assembly: SecurityRules(SecurityRuleSet.Level2, SkipVerificationInFullTrust = true)]
4040
#endif

NetJSON/lib/net35/NetJSON.dll

0 Bytes
Binary file not shown.

NetJSON/lib/net35/NetJSON.pdb

0 Bytes
Binary file not shown.

NetJSON/lib/net40/NetJSON.dll

0 Bytes
Binary file not shown.

NetJSON/lib/net40/NetJSON.pdb

0 Bytes
Binary file not shown.

NetJSON/lib/net462/NetJSON.dll

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)