Skip to content

Commit 070bc0d

Browse files
committed
Fixed issue with not been able to deserialize boolean array (or non string based array caused by missing setting to current (ptr[index]). Added test from .net 4 to .net 7 to increase code coverage
1 parent d24e3e2 commit 070bc0d

24 files changed

+3394
-9
lines changed

NetJSON.Net7_0.Tests/Models.cs

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace NetJSON.Tests {
8+
public class ErrorData {
9+
public int code { get; set; }
10+
11+
public string message { get; set; }
12+
}
13+
14+
public class JsonRpcResponse<T> {
15+
public T result { get; set; }
16+
17+
public ErrorData error { get; set; }
18+
19+
public bool IsError {
20+
get { return this.error != null; }
21+
}
22+
23+
public int id { get; set; }
24+
}
25+
26+
public class AccountFundsResponse {
27+
public double availableToBetBalance { get; set; }
28+
29+
public double exposure { get; set; }
30+
31+
public double retainedCommission { get; set; }
32+
33+
public double exposureLimit { get; set; }
34+
}
35+
36+
37+
public class MccUserData {
38+
public MccUserData() {
39+
40+
}
41+
42+
public int ifjhklfdfjlkdjfldgfdgdgdfgdgdgdf = 0;
43+
44+
public enum eTestE {
45+
One = 1,
46+
Two = 2,
47+
Three = 1,
48+
}
49+
50+
public eTestE TestEnum { get; set; }
51+
52+
public TType1 tt1 { get; set; }
53+
54+
public long CustomerId { get; set; }
55+
56+
public long HostId { get; set; }
57+
58+
public string Login { get; set; }
59+
60+
public bool Active { get; set; }
61+
62+
public DateTime DtuCreated { get; set; }
63+
64+
public DateTime ExpirationDate { get; set; }
65+
public DateTime? ExpirationDate1 { get; set; }
66+
67+
public bool LoggingPermission { get; set; }
68+
69+
70+
public string Language { get; set; }
71+
72+
public int CultureId { get; set; }
73+
74+
public bool IsAppSubscriber { get; set; }
75+
76+
public byte[] RowKey { get; set; }
77+
78+
public HashSet<string> SubscribedApps { get; set; }
79+
80+
81+
public string CompanyBindingId { get; set; }
82+
83+
public bool IDT_Enabled { get; set; }
84+
85+
public DateTime IDT_ExpirationDate { get; set; }
86+
87+
public bool IDT_PlayStore { get; set; }
88+
89+
public float FloaTest { get; set; }
90+
public double DoubleTest { get; set; }
91+
public decimal DecimalTest { get; set; }
92+
public double DoubleNullTest { get; set; }
93+
public char CharTest { get; set; }
94+
95+
public Dictionary<int, string> rD { get; set; }
96+
97+
public Dictionary<int, TType1> rObj { get; set; }
98+
99+
public int?[] arr { get; set; }
100+
101+
public List<string> sdt { get; set; }
102+
103+
public string TestString { get; set; }
104+
105+
public sbyte TestByte { get; set; }
106+
107+
public TimeSpan TestTimeSpan { get; set; }
108+
109+
public Guid TestGuid { get; set; }
110+
111+
public int[][] arr1 { get; set; }
112+
}
113+
114+
public class TType1 {
115+
public long P1 = 12;
116+
public float P2 = 4.5f;
117+
public int? P4 = null;
118+
}
119+
}

NetJSON.Net7_0.Tests/NetJSON.Net7_0.Tests.csproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<ItemGroup>
1010
<PackageReference Include="Bogus" Version="34.0.2" />
11+
<PackageReference Include="DeepEqual" Version="4.2.1" />
1112
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
1213
<PackageReference Include="xunit" Version="2.4.0" />
1314
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
@@ -18,4 +19,19 @@
1819
<ProjectReference Include="..\NetJSON.Net7_0\NetJSON.Net7_0.csproj" />
1920
</ItemGroup>
2021

22+
<ItemGroup>
23+
<Content Update="trackerjson.txt">
24+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
25+
</Content>
26+
<Content Update="netjsonObj.txt">
27+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
28+
</Content>
29+
<Content Update="netjson_test.txt">
30+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
31+
</Content>
32+
<Content Update="json.txt">
33+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
34+
</Content>
35+
</ItemGroup>
36+
2137
</Project>

0 commit comments

Comments
 (0)