Skip to content

Commit

Permalink
Update calls in Json tests from GetStringValue to GetString (dotnet/c…
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsonkhan authored and ViktorHofer committed Jan 19, 2019
1 parent 3a02c1e commit 3095976
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/libraries/System.Text.Json/tests/JsonTestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public static byte[] ReaderLoop(int inpuDataLength, out int length, ref Utf8Json
if (json.HasValueSequence)
{
Assert.True(json.ValueSpan == default);
if ((tokenType != JsonTokenType.String && tokenType != JsonTokenType.PropertyName) || json.GetStringValue().Length != 0)
if ((tokenType != JsonTokenType.String && tokenType != JsonTokenType.PropertyName) || json.GetString().Length != 0)
{
// Empty strings could still make this true, i.e. ""
Assert.False(json.ValueSequence.IsEmpty);
Expand All @@ -225,7 +225,7 @@ public static byte[] ReaderLoop(int inpuDataLength, out int length, ref Utf8Json
else
{
Assert.True(json.ValueSequence.IsEmpty);
if ((tokenType != JsonTokenType.String && tokenType != JsonTokenType.PropertyName) || json.GetStringValue().Length != 0)
if ((tokenType != JsonTokenType.String && tokenType != JsonTokenType.PropertyName) || json.GetString().Length != 0)
{
// Empty strings could still make this true, i.e. ""
Assert.False(json.ValueSpan == default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,11 @@ public static void TestingGetString(string jsonString)
{
if (json.TokenType == JsonTokenType.String)
{
actualValues.Add(json.GetStringValue());
actualValues.Add(json.GetString());
}
else if (json.TokenType == JsonTokenType.PropertyName)
{
actualPropertyNames.Add(json.GetStringValue());
actualPropertyNames.Add(json.GetString());
}
}

Expand Down Expand Up @@ -721,7 +721,7 @@ public static void TestingGetStringInvalidUTF16(string jsonString)
Assert.Equal(JsonTokenType.String, json.TokenType);
try
{
string val = json.GetStringValue();
string val = json.GetString();
Assert.True(false, "Expected InvalidOperationException when trying to get string value for invalid UTF-16 JSON text.");
}
catch (InvalidOperationException) { }
Expand Down Expand Up @@ -754,7 +754,7 @@ public static void TestingGetStringInvalidUTF8(byte[] dataUtf8)
{
try
{
string val = json.GetStringValue();
string val = json.GetString();
Assert.True(false, "Expected InvalidOperationException when trying to get string value for invalid UTF-8 JSON text.");
}
catch (InvalidOperationException ex)
Expand Down

0 comments on commit 3095976

Please sign in to comment.