Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Writable Json DOM - JsonNumber implementation and tests #39917

Merged
35 commits merged into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8013865
Json prototype (#1)
kasiabulat Jul 17, 2019
0f7df28
Json prototype - transformation API (#2)
kasiabulat Jul 19, 2019
6cd2efb
Json prototype (#1)
kasiabulat Jul 17, 2019
409e575
Json prototype - transformation API (#2)
kasiabulat Jul 19, 2019
25109c3
Merge branch 'master' of https://github.com/kasiabulat/corefx
kasiabulat Jul 29, 2019
9dcfc4b
JsonNumber implementation and tests (#3)
kasiabulat Jul 30, 2019
38af6d9
Merge remote-tracking branch 'upstream/master'
kasiabulat Jul 30, 2019
08f4734
all unimplemented classes and methods with accompanying tests removed
kasiabulat Jul 30, 2019
63ff329
First part of documentation added
kasiabulat Jul 30, 2019
0e0fb7c
documentation completed
kasiabulat Jul 31, 2019
47666ce
missing exceptions added
kasiabulat Jul 31, 2019
d856681
JsonElement changes removed
kasiabulat Jul 31, 2019
22e6558
part of the review comments included
kasiabulat Aug 1, 2019
04441f1
work on review comments
kasiabulat Aug 1, 2019
30c5dd0
code refactor
kasiabulat Aug 5, 2019
8f3e510
more decimal tests added using MemberData
kasiabulat Aug 5, 2019
c6ab148
more decimal tests added using MemberData
kasiabulat Aug 5, 2019
259590b
more test cases added
kasiabulat Aug 5, 2019
c4d6ef2
equals summary adjusted, equals tests added
kasiabulat Aug 5, 2019
01c230f
more Equals tests added, GetHashCode tests added, minor changes
kasiabulat Aug 6, 2019
392142a
scientifing notation support added, rational numbers tests fixes
kasiabulat Aug 6, 2019
310a5a6
rational overflow tests added
kasiabulat Aug 6, 2019
e03b803
ulong maxvalue tests added to rational types
kasiabulat Aug 6, 2019
95a9401
presision problems fixes
kasiabulat Aug 6, 2019
2bd6871
exception strings fixed
kasiabulat Aug 6, 2019
f0c4814
CI failing fixes (hopefully), review comments included
kasiabulat Aug 7, 2019
c22b36d
missing == tests added to achieve 100% branch coverage
kasiabulat Aug 7, 2019
7dfc891
review comments included
kasiabulat Aug 8, 2019
07746d8
Merge remote-tracking branch 'upstream/master' into kasiabulat/json-n…
kasiabulat Aug 8, 2019
d479fa7
Merge remote-tracking branch 'upstream/master' into kasiabulat/json-n…
kasiabulat Aug 8, 2019
ab1401a
trailing whitespaces fixes
kasiabulat Aug 8, 2019
217bade
equals comments added
kasiabulat Aug 8, 2019
40a6649
equals object refactored to call quals json number
kasiabulat Aug 8, 2019
af4aed3
Merge conflicts resolved
kasiabulat Aug 8, 2019
f534415
merge fix
kasiabulat Aug 8, 2019
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
91 changes: 91 additions & 0 deletions src/System.Text.Json/ref/System.Text.Json.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,97 @@ protected JsonNamingPolicy() { }
public static System.Text.Json.JsonNamingPolicy CamelCase { get { throw null; } }
public abstract string ConvertName(string name);
}
public abstract partial class JsonNode
{
internal JsonNode() { }
}
public partial class JsonNumber : System.Text.Json.JsonNode, System.IEquatable<System.Text.Json.JsonNumber>
kasiabulat marked this conversation as resolved.
Show resolved Hide resolved
{
public JsonNumber() { }
public JsonNumber(byte value) { }
public JsonNumber(decimal value) { }
public JsonNumber(double value) { }
public JsonNumber(short value) { }
public JsonNumber(int value) { }
public JsonNumber(long value) { }
[System.CLSCompliantAttribute(false)]
public JsonNumber(sbyte value) { }
public JsonNumber(float value) { }
public JsonNumber(string value) { }
[System.CLSCompliantAttribute(false)]
public JsonNumber(ushort value) { }
[System.CLSCompliantAttribute(false)]
public JsonNumber(uint value) { }
[System.CLSCompliantAttribute(false)]
public JsonNumber(ulong value) { }
public override bool Equals(object obj) { throw null; }
public bool Equals(System.Text.Json.JsonNumber other) { throw null; }
public byte GetByte() { throw null; }
public decimal GetDecimal() { throw null; }
public double GetDouble() { throw null; }
public override int GetHashCode() { throw null; }
public short GetInt16() { throw null; }
public int GetInt32() { throw null; }
public long GetInt64() { throw null; }
[System.CLSCompliantAttribute(false)]
public sbyte GetSByte() { throw null; }
public float GetSingle() { throw null; }
[System.CLSCompliantAttribute(false)]
public ushort GetUInt16() { throw null; }
[System.CLSCompliantAttribute(false)]
public uint GetUInt32() { throw null; }
[System.CLSCompliantAttribute(false)]
public ulong GetUInt64() { throw null; }
public static bool operator ==(System.Text.Json.JsonNumber left, System.Text.Json.JsonNumber right) { throw null; }
public static implicit operator System.Text.Json.JsonNumber (byte value) { throw null; }
public static implicit operator System.Text.Json.JsonNumber (decimal value) { throw null; }
public static implicit operator System.Text.Json.JsonNumber (double value) { throw null; }
public static implicit operator System.Text.Json.JsonNumber (short value) { throw null; }
public static implicit operator System.Text.Json.JsonNumber (int value) { throw null; }
public static implicit operator System.Text.Json.JsonNumber (long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Text.Json.JsonNumber (sbyte value) { throw null; }
public static implicit operator System.Text.Json.JsonNumber (float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Text.Json.JsonNumber (ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Text.Json.JsonNumber (uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Text.Json.JsonNumber (ulong value) { throw null; }
public static bool operator !=(System.Text.Json.JsonNumber left, System.Text.Json.JsonNumber right) { throw null; }
public void SetByte(byte value) { }
public void SetDecimal(decimal value) { }
public void SetDouble(double value) { }
public void SetFormattedValue(string value) { }
public void SetInt16(short value) { }
public void SetInt32(int value) { }
public void SetInt64(long value) { }
[System.CLSCompliantAttribute(false)]
public void SetSByte(sbyte value) { }
public void SetSingle(float value) { }
[System.CLSCompliantAttribute(false)]
public void SetUInt16(ushort value) { }
[System.CLSCompliantAttribute(false)]
public void SetUInt32(uint value) { }
[System.CLSCompliantAttribute(false)]
public void SetUInt64(ulong value) { }
public override string ToString() { throw null; }
public bool TryGetByte(out byte value) { throw null; }
public bool TryGetDecimal(out decimal value) { throw null; }
public bool TryGetDouble(out double value) { throw null; }
public bool TryGetInt16(out short value) { throw null; }
public bool TryGetInt32(out int value) { throw null; }
public bool TryGetInt64(out long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public bool TryGetSByte(out sbyte value) { throw null; }
public bool TryGetSingle(out float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public bool TryGetUInt16(out ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public bool TryGetUInt32(out uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public bool TryGetUInt64(out ulong value) { throw null; }
}
public readonly partial struct JsonProperty
{
private readonly object _dummy;
Expand Down
8 changes: 7 additions & 1 deletion src/System.Text.Json/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,10 @@
<data name="FormatUInt16" xml:space="preserve">
<value>Either the JSON value is not in a supported format, or is out of bounds for a UInt16.</value>
</data>
</root>
<data name="EmptyStringToInitializeNumber" xml:space="preserve">
<value>Expected a number, but instead got empty string.</value>
</data>
<data name="IllegalNumberFormat" xml:space="preserve">
kasiabulat marked this conversation as resolved.
Show resolved Hide resolved
<value>Provided value does not represent legal JSON number.</value>
kasiabulat marked this conversation as resolved.
Show resolved Hide resolved
kasiabulat marked this conversation as resolved.
Show resolved Hide resolved
</data>
</root>
4 changes: 4 additions & 0 deletions src/System.Text.Json/src/System.Text.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,8 @@
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Threading.Tasks.Extensions" />
</ItemGroup>
<ItemGroup>
<Compile Include="System\Text\Json\Node\JsonNode.cs" />
<Compile Include="System\Text\Json\Node\JsonNumber.cs" />
</ItemGroup>
</Project>
14 changes: 14 additions & 0 deletions src/System.Text.Json/src/System/Text/Json/Node/JsonNode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace System.Text.Json
{
/// <summary>
/// The base class that represents a single node within a JSON document.
/// </summary>
public abstract class JsonNode
{
private protected JsonNode() { }
ahsonkhan marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading