@@ -187,7 +187,7 @@ public void WithViewData_GivenUnexpectedKey_ShouldFail()
187
187
}
188
188
189
189
[ Test ]
190
- public void Model_ForViewResult_GivenExpectedValue_ShouldPass ( )
190
+ public void Model_GivenExpectedValue_ShouldPass ( )
191
191
{
192
192
ActionResult result = new ViewResult
193
193
{
@@ -196,20 +196,9 @@ public void Model_ForViewResult_GivenExpectedValue_ShouldPass()
196
196
197
197
result . Should ( ) . BeViewResult ( ) . Model . Should ( ) . Be ( "hello" ) ;
198
198
}
199
-
199
+
200
200
[ Test ]
201
- public void Model_ForPartialViewResult_GivenExpectedValue_ShouldPass ( )
202
- {
203
- ActionResult result = new PartialViewResult
204
- {
205
- ViewData = new ViewDataDictionary ( "hello" )
206
- } ;
207
-
208
- result . Should ( ) . BePartialViewResult ( ) . Model . Should ( ) . Be ( "hello" ) ;
209
- }
210
-
211
- [ Test ]
212
- public void Model_ForViewResult_GivenUnexpectedValue_ShouldFail ( )
201
+ public void Model_GivenUnexpectedValue_ShouldFail ( )
213
202
{
214
203
ActionResult result = new ViewResult
215
204
{
@@ -219,21 +208,9 @@ public void Model_ForViewResult_GivenUnexpectedValue_ShouldFail()
219
208
Action a = ( ) => result . Should ( ) . BeViewResult ( ) . Model . Should ( ) . Be ( "xyx" ) ;
220
209
a . ShouldThrow < Exception > ( ) ;
221
210
}
222
-
211
+
223
212
[ Test ]
224
- public void Model_ForPartialViewResult_GivenUnexpectedValue_ShouldFail ( )
225
- {
226
- ActionResult result = new PartialViewResult
227
- {
228
- ViewData = new ViewDataDictionary ( "hello" )
229
- } ;
230
-
231
- Action a = ( ) => result . Should ( ) . BePartialViewResult ( ) . Model . Should ( ) . Be ( "xyx" ) ;
232
- a . ShouldThrow < Exception > ( ) ;
233
- }
234
-
235
- [ Test ]
236
- public void ModelAs_ForViewResult_GivenExpectedValue_ShouldPass ( )
213
+ public void ModelAs_GivenExpectedValue_ShouldPass ( )
237
214
{
238
215
ActionResult result = new ViewResult
239
216
{
@@ -244,18 +221,7 @@ public void ModelAs_ForViewResult_GivenExpectedValue_ShouldPass()
244
221
}
245
222
246
223
[ Test ]
247
- public void ModelAs_ForPartialViewResult_GivenExpectedValue_ShouldPass ( )
248
- {
249
- ActionResult result = new PartialViewResult
250
- {
251
- ViewData = new ViewDataDictionary ( "hello" )
252
- } ;
253
-
254
- result . Should ( ) . BePartialViewResult ( ) . ModelAs < string > ( ) . Should ( ) . Be ( "hello" ) ;
255
- }
256
-
257
- [ Test ]
258
- public void ModelAs_ForViewResult_GivenUnexpectedValue_ShouldFail ( )
224
+ public void ModelAs_GivenUnexpectedValue_ShouldFail ( )
259
225
{
260
226
ActionResult result = new ViewResult
261
227
{
@@ -265,21 +231,9 @@ public void ModelAs_ForViewResult_GivenUnexpectedValue_ShouldFail()
265
231
Action a = ( ) => result . Should ( ) . BeViewResult ( ) . ModelAs < string > ( ) . Should ( ) . Be ( "xyx" ) ;
266
232
a . ShouldThrow < Exception > ( ) ;
267
233
}
268
-
234
+
269
235
[ Test ]
270
- public void ModelAs_ForPartialViewResult_GivenUnexpectedValue_ShouldFail ( )
271
- {
272
- ActionResult result = new PartialViewResult
273
- {
274
- ViewData = new ViewDataDictionary ( "hello" )
275
- } ;
276
-
277
- Action a = ( ) => result . Should ( ) . BePartialViewResult ( ) . ModelAs < string > ( ) . Should ( ) . Be ( "xyx" ) ;
278
- a . ShouldThrow < Exception > ( ) ;
279
- }
280
-
281
- [ Test ]
282
- public void ModelAs_ForViewResult_GivenWrongType_ShouldFail ( )
236
+ public void ModelAs_GivenWrongType_ShouldFail ( )
283
237
{
284
238
ActionResult result = new ViewResult
285
239
{
@@ -289,21 +243,9 @@ public void ModelAs_ForViewResult_GivenWrongType_ShouldFail()
289
243
Action a = ( ) => result . Should ( ) . BeViewResult ( ) . ModelAs < int > ( ) . Should ( ) . Be ( 2 ) ;
290
244
a . ShouldThrow < Exception > ( ) ;
291
245
}
292
-
293
- [ Test ]
294
- public void ModelAs_ForPartialViewResult_GivenWrongType_ShouldFail ( )
295
- {
296
- ActionResult result = new PartialViewResult
297
- {
298
- ViewData = new ViewDataDictionary ( "hello" )
299
- } ;
300
-
301
- Action a = ( ) => result . Should ( ) . BePartialViewResult ( ) . ModelAs < int > ( ) . Should ( ) . Be ( 2 ) ;
302
- a . ShouldThrow < Exception > ( ) ;
303
- }
304
-
246
+
305
247
[ Test ]
306
- public void ModelAs_ForViewResult_Null_ShouldFail ( )
248
+ public void ModelAs_Null_ShouldFail ( )
307
249
{
308
250
ActionResult result = new ViewResult ( ) ;
309
251
string failureMessage = FailureMessageHelper . Format ( FailureMessages . ViewResultBase_NullModel , typeof ( Object ) . Name ) ;
@@ -313,19 +255,7 @@ public void ModelAs_ForViewResult_Null_ShouldFail()
313
255
a . ShouldThrow < Exception > ( )
314
256
. WithMessage ( failureMessage ) ;
315
257
}
316
-
317
- [ Test ]
318
- public void ModelAs_ForPartialViewResult_Null_ShouldFail ( )
319
- {
320
- ActionResult result = new PartialViewResult ( ) ;
321
- string failureMessage = FailureMessageHelper . Format ( FailureMessages . ViewResultBase_NullModel , typeof ( Object ) . Name ) ;
322
-
323
- Action a = ( ) => result . Should ( ) . BePartialViewResult ( ) . ModelAs < Object > ( ) ;
324
-
325
- a . ShouldThrow < Exception > ( )
326
- . WithMessage ( failureMessage ) ;
327
- }
328
-
258
+
329
259
[ Test ]
330
260
public void WithDefaultViewName_GivenExpectedValue_ShouldPass ( )
331
261
{
0 commit comments