Skip to content

Commit d1b8d22

Browse files
committed
add reproduction test
1 parent 47b4abf commit d1b8d22

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/GraphQL.Client.Serializer.Tests/BaseSerializerTest.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.IO;
23
using System.Text;
34
using System.Threading;
@@ -118,5 +119,26 @@ public async void CanDoSerializationWithPredefinedTypes()
118119

119120
Assert.Equal(message, response.Data.AddMessage.Content);
120121
}
122+
123+
124+
public class WithNullable
125+
{
126+
public int? NullableInt { get; set; }
127+
}
128+
129+
[Fact]
130+
public void CanSerializeNullableInt()
131+
{
132+
Action action = () => Serializer.SerializeToString(new GraphQLRequest
133+
{
134+
Query = "{}",
135+
Variables = new WithNullable
136+
{
137+
NullableInt = 2
138+
}
139+
});
140+
141+
action.Should().NotThrow();
142+
}
121143
}
122144
}

0 commit comments

Comments
 (0)