File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
test/Microsoft.OpenApi.Tests/Writers Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,51 @@ public void WriteOpenApiIntergerAsJsonWorks(int input)
39
39
json . Should ( ) . Be ( input . ToString ( ) ) ;
40
40
}
41
41
42
+ [ Theory ]
43
+ [ InlineData ( - 100 ) ]
44
+ [ InlineData ( 0 ) ]
45
+ [ InlineData ( long . MaxValue ) ]
46
+ public void WriteOpenApiLongAsJsonWorks ( long input )
47
+ {
48
+ // Arrange
49
+ var longValue = new OpenApiLong ( input ) ;
50
+
51
+ var json = WriteAsJson ( longValue ) ;
52
+
53
+ // Assert
54
+ json . Should ( ) . Be ( input . ToString ( ) ) ;
55
+ }
56
+
57
+ [ Theory ]
58
+ [ InlineData ( - 100.1 ) ]
59
+ [ InlineData ( 0.0 ) ]
60
+ [ InlineData ( 42.42 ) ]
61
+ public void WriteOpenApiFloatAsJsonWorks ( float input )
62
+ {
63
+ // Arrange
64
+ var floatValue = new OpenApiFloat ( input ) ;
65
+
66
+ var json = WriteAsJson ( floatValue ) ;
67
+
68
+ // Assert
69
+ json . Should ( ) . Be ( input . ToString ( ) ) ;
70
+ }
71
+
72
+ [ Theory ]
73
+ [ InlineData ( - 100.1 ) ]
74
+ [ InlineData ( 0.0 ) ]
75
+ [ InlineData ( 42.42 ) ]
76
+ public void WriteOpenApiDoubleAsJsonWorks ( double input )
77
+ {
78
+ // Arrange
79
+ var doubleValue = new OpenApiDouble ( input ) ;
80
+
81
+ var json = WriteAsJson ( doubleValue ) ;
82
+
83
+ // Assert
84
+ json . Should ( ) . Be ( input . ToString ( ) ) ;
85
+ }
86
+
42
87
[ Theory ]
43
88
[ InlineData ( true ) ]
44
89
[ InlineData ( false ) ]
You can’t perform that action at this time.
0 commit comments