File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/GraphQLParser.Tests/Visitors Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System . Text ;
1
2
using GraphQLParser . Visitors ;
2
3
3
4
namespace GraphQLParser . Tests . Visitors ;
@@ -750,6 +751,26 @@ public async Task Directive_Without_Parent_Should_Be_Printed()
750
751
writer . ToString ( ) . ShouldBe ( "@upper" ) ;
751
752
}
752
753
754
+ [ Fact ]
755
+ public void StringBuilder_Runs_Synchronously ( )
756
+ {
757
+ var document = "KitchenSink" . ReadGraphQLFile ( ) . Parse ( ) ;
758
+ var sb = new StringBuilder ( ) ;
759
+ using var writer = new StringWriter ( sb ) ;
760
+ var printer = new SDLPrinter ( ) ;
761
+ printer . PrintAsync ( document , writer ) . IsCompletedSuccessfully . ShouldBeTrue ( ) ;
762
+ }
763
+
764
+ [ Fact ]
765
+ public void UTF8_MemoryStream_Runs_Synchronously ( )
766
+ {
767
+ var document = "KitchenSink" . ReadGraphQLFile ( ) . Parse ( ) ;
768
+ using var ms = new MemoryStream ( ) ;
769
+ using var writer = new StreamWriter ( ms ) ;
770
+ var printer = new SDLPrinter ( ) ;
771
+ printer . PrintAsync ( document , writer ) . IsCompletedSuccessfully . ShouldBeTrue ( ) ;
772
+ }
773
+
753
774
[ Theory ]
754
775
[ InlineData ( "query a { name }" ) ]
755
776
[ InlineData ( "directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT" ) ]
You can’t perform that action at this time.
0 commit comments