This repository was archived by the owner on Dec 18, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
test/Microsoft.AspNetCore.Server.KestrelTests Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ public void ThrowsWhenAddingHeaderAfterReadOnlyIsSet()
102
102
var headers = new FrameResponseHeaders ( ) ;
103
103
headers . SetReadOnly ( ) ;
104
104
105
- Assert . Throws < InvalidOperationException > ( ( ) => ( ( IDictionary < string , StringValues > ) headers ) . Add ( "my-header" , new [ ] { "value" } ) ) ;
105
+ Assert . Throws < BadHttpResponseException > ( ( ) => ( ( IDictionary < string , StringValues > ) headers ) . Add ( "my-header" , new [ ] { "value" } ) ) ;
106
106
}
107
107
108
108
[ Fact ]
@@ -113,7 +113,7 @@ public void ThrowsWhenChangingHeaderAfterReadOnlyIsSet()
113
113
dictionary . Add ( "my-header" , new [ ] { "value" } ) ;
114
114
headers . SetReadOnly ( ) ;
115
115
116
- Assert . Throws < InvalidOperationException > ( ( ) => dictionary [ "my-header" ] = "other-value" ) ;
116
+ Assert . Throws < BadHttpResponseException > ( ( ) => dictionary [ "my-header" ] = "other-value" ) ;
117
117
}
118
118
119
119
[ Fact ]
@@ -124,7 +124,7 @@ public void ThrowsWhenRemovingHeaderAfterReadOnlyIsSet()
124
124
dictionary . Add ( "my-header" , new [ ] { "value" } ) ;
125
125
headers . SetReadOnly ( ) ;
126
126
127
- Assert . Throws < InvalidOperationException > ( ( ) => dictionary . Remove ( "my-header" ) ) ;
127
+ Assert . Throws < BadHttpResponseException > ( ( ) => dictionary . Remove ( "my-header" ) ) ;
128
128
}
129
129
130
130
[ Fact ]
@@ -135,7 +135,7 @@ public void ThrowsWhenClearingHeadersAfterReadOnlyIsSet()
135
135
dictionary . Add ( "my-header" , new [ ] { "value" } ) ;
136
136
headers . SetReadOnly ( ) ;
137
137
138
- Assert . Throws < InvalidOperationException > ( ( ) => dictionary . Clear ( ) ) ;
138
+ Assert . Throws < BadHttpResponseException > ( ( ) => dictionary . Clear ( ) ) ;
139
139
}
140
140
}
141
141
}
Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ public void ThrowsWhenStatusCodeIsSetAfterResponseStarted()
415
415
416
416
// Assert
417
417
Assert . True ( frame . HasResponseStarted ) ;
418
- Assert . Throws < InvalidOperationException > ( ( ) => ( ( IHttpResponseFeature ) frame ) . StatusCode = 404 ) ;
418
+ Assert . Throws < BadHttpResponseException > ( ( ) => ( ( IHttpResponseFeature ) frame ) . StatusCode = 404 ) ;
419
419
}
420
420
421
421
[ Fact ]
@@ -437,7 +437,7 @@ public void ThrowsWhenReasonPhraseIsSetAfterResponseStarted()
437
437
438
438
// Assert
439
439
Assert . True ( frame . HasResponseStarted ) ;
440
- Assert . Throws < InvalidOperationException > ( ( ) => ( ( IHttpResponseFeature ) frame ) . ReasonPhrase = "Reason phrase" ) ;
440
+ Assert . Throws < BadHttpResponseException > ( ( ) => ( ( IHttpResponseFeature ) frame ) . ReasonPhrase = "Reason phrase" ) ;
441
441
}
442
442
443
443
[ Fact ]
You can’t perform that action at this time.
0 commit comments