@@ -30,6 +30,25 @@ public async Task Get_ReturnsOkResponse()
30
30
response . Should ( ) . Be200Ok ( ) ;
31
31
}
32
32
33
+ [ Theory ]
34
+ [ InlineData ( 1 ) ]
35
+ [ InlineData ( 10 ) ]
36
+ [ InlineData ( 50 ) ]
37
+ [ InlineData ( 100 ) ]
38
+ [ InlineData ( 1000 ) ] // this is not truncated
39
+ [ InlineData ( 2000 ) ] // this is not truncated
40
+ public async Task GetData_ReturnsOkResponse ( int howMuchData )
41
+ {
42
+ // Arrange
43
+ var client = _factory . CreateClient ( ) ;
44
+
45
+ // Act
46
+ var response = await client . GetAsync ( $ "/api/values/generated/{ howMuchData } ") ;
47
+
48
+ // Assert
49
+ response . Should ( ) . Be200Ok ( ) ;
50
+ }
51
+
33
52
[ Fact ]
34
53
public async Task Get_WithId_ReturnsOkResponse ( )
35
54
{
@@ -49,7 +68,7 @@ public async Task Get_WithId_ReturnsOk_And_Expected_Model()
49
68
// Arrange
50
69
var client = _factory . CreateClient ( ) ;
51
70
client . DefaultRequestHeaders
52
- . Accept . Add ( new MediaTypeWithQualityHeaderValue ( "application/json" ) ) ;
71
+ . Accept . Add ( new MediaTypeWithQualityHeaderValue ( "application/json" ) ) ;
53
72
54
73
// Act
55
74
var response = await client . GetAsync ( "/api/values/1" ) ;
@@ -74,18 +93,18 @@ public async Task Patch_Returns404NotFound()
74
93
#endif
75
94
76
95
#if NETCOREAPP3_0 || NETCOREAPP3_1
77
- [ Fact ]
78
- public async Task Patch_ReturnsMethodNotAllowed ( )
79
- {
80
- // Arrange
81
- var client = _factory . CreateClient ( ) ;
82
-
83
- // Act
84
- var response = await client . PatchAsync ( "/api/values" , new StringContent ( "" , Encoding . UTF32 , "application/json" ) ) ;
85
-
86
- // Assert
87
- response . Should ( ) . Be405MethodNotAllowed ( ) ;
88
- }
96
+ [ Fact ]
97
+ public async Task Patch_ReturnsMethodNotAllowed ( )
98
+ {
99
+ // Arrange
100
+ var client = _factory . CreateClient ( ) ;
101
+
102
+ // Act
103
+ var response = await client . PatchAsync ( "/api/values" , new StringContent ( "" , Encoding . UTF32 , "application/json" ) ) ;
104
+
105
+ // Assert
106
+ response . Should ( ) . Be405MethodNotAllowed ( ) ;
107
+ }
89
108
#endif
90
109
91
110
[ Fact ]
@@ -112,11 +131,11 @@ public async Task Post_WithNoContent_ReturnsBadRequest()
112
131
113
132
// Assert
114
133
#if NETCOREAPP2_2 || NET5_0_OR_GREATER
115
- response . Should ( ) . Be400BadRequest ( )
116
- . And . HaveErrorMessage ( "A non-empty request body is required." ) ;
134
+ response . Should ( ) . Be400BadRequest ( )
135
+ . And . HaveErrorMessage ( "A non-empty request body is required." ) ;
117
136
#elif NETCOREAPP3_0 || NETCOREAPP3_1
118
- response . Should ( ) . Be400BadRequest ( )
119
- . And . HaveErrorMessage ( "*The input does not contain any JSON tokens*" ) ;
137
+ response . Should ( ) . Be400BadRequest ( )
138
+ . And . HaveErrorMessage ( "*The input does not contain any JSON tokens*" ) ;
120
139
#endif
121
140
}
122
141
0 commit comments