Skip to content

Commit 3128c04

Browse files
Kristoffer Lerbæk PedersenHavret
authored andcommitted
Uncomment tests and update approved results
1 parent c8371a0 commit 3128c04

7 files changed

Lines changed: 16 additions & 13 deletions

test/Protobuf.System.Text.Json.Tests/DefaultIgnoreConditionTests.Should_not_ignore_default_non_nullable_properties_when_DefaultIgnoreCondition_set_to_WhenWritingNull.approved.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"sfixed32Property": 0,
1313
"sfixed64Property": 0,
1414
"boolProperty": false,
15-
"stringProperty": ""
15+
"stringProperty": "",
16+
"bytesProperty": ""
1617
}

test/Protobuf.System.Text.Json.Tests/DefaultIgnoreConditionTests.Should_not_ignore_default_properties_when_DefaultIgnoreCondition_set_to_Never.approved.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"sfixed32Property": 0,
1313
"sfixed64Property": 0,
1414
"boolProperty": false,
15-
"stringProperty": ""
15+
"stringProperty": "",
16+
"bytesProperty": ""
1617
}

test/Protobuf.System.Text.Json.Tests/JsonNamingPolicyTests.Should_ignore_PropertyNamingPolicy_when_UseProtobufJsonNames_set_to_true.approved.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"sfixed32Property": 0,
1313
"sfixed64Property": 0,
1414
"boolProperty": false,
15-
"stringProperty": ""
15+
"stringProperty": "",
16+
"bytesProperty": ""
1617
}

test/Protobuf.System.Text.Json.Tests/JsonNamingPolicyTests.Should_serialize_message_with_primitive_types.approved.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"sfixed32property": 0,
1313
"sfixed64property": 0,
1414
"boolproperty": false,
15-
"stringproperty": ""
15+
"stringproperty": "",
16+
"bytesproperty": ""
1617
}

test/Protobuf.System.Text.Json.Tests/Protos/simple_message.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@ message SimpleMessage {
3131

3232
string string_property = 14;
3333

34-
// TODO: Support bytes property
35-
// bytes bytes_property = 15;
34+
bytes bytes_property = 15;
3635
}

test/Protobuf.System.Text.Json.Tests/SimpleMessageTests.Should_serialize_message_with_primitive_types.approved.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"sfixed32Property": 9,
1313
"sfixed64Property": 10,
1414
"boolProperty": true,
15-
"stringProperty": "hello"
15+
"stringProperty": "hello",
16+
"bytesProperty": "YWJj"
1617
}

test/Protobuf.System.Text.Json.Tests/SimpleMessageTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Text.Json;
22
using System.Text.Json.Protobuf.Tests;
3+
using Google.Protobuf;
34
using Protobuf.System.Text.Json.Tests.Utils;
45
using Shouldly;
56
using SmartAnalyzers.ApprovalTestsExtensions;
@@ -28,9 +29,8 @@ public void Should_serialize_message_with_primitive_types()
2829
Sfixed32Property = 9,
2930
Sfixed64Property = 10,
3031
BoolProperty = true,
31-
StringProperty = "hello"
32-
// TODO: Support bytes property
33-
// BytesProperty = ByteString.CopyFromUtf8("abc")
32+
StringProperty = "hello",
33+
BytesProperty = ByteString.CopyFromUtf8("abc")
3434
};
3535
var jsonSerializerOptions = TestHelper.CreateJsonSerializerOptions();
3636

@@ -61,9 +61,8 @@ public void Should_deserialize_message_with_primitive_types()
6161
Sfixed32Property = 9,
6262
Sfixed64Property = 10,
6363
BoolProperty = true,
64-
StringProperty = "hello"
65-
// TODO: Support bytes property
66-
// BytesProperty = ByteString.CopyFromUtf8("abc")
64+
StringProperty = "hello",
65+
BytesProperty = ByteString.CopyFromUtf8("abc")
6766
};
6867
var jsonSerializerOptions = TestHelper.CreateJsonSerializerOptions();
6968

0 commit comments

Comments
 (0)