Skip to content

Commit 8ae342a

Browse files
author
hristo.h
committed
Modified asserted exception messages
1 parent 4fe4da0 commit 8ae342a

File tree

13 files changed

+25
-50
lines changed

13 files changed

+25
-50
lines changed

test/MyTested.AspNetCore.Mvc.Controllers.ActionResults.Test/BuildersTests/ActionResultsTests/BadRequestTests/BadRequestTestBuilderTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,8 @@ public void PassingShouldThrowAnExceptionOnAnIncorrectAssertion()
532532
.ShouldReturn()
533533
.BadRequest(badRequest => badRequest
534534
.Passing(br => br.Formatters?.Count == 0));
535-
},
536-
$"When calling {nameof(MvcController.FullHttpBadRequestAction)} " +
537-
$"action in {nameof(MvcController)} expected the BadRequestObjectResult to pass the given predicate, but it failed.");
535+
},
536+
$"When calling FullHttpBadRequestAction action in MvcController expected the BadRequestObjectResult to pass the given predicate, but it failed.");
538537
}
539538

540539
[Fact]

test/MyTested.AspNetCore.Mvc.Controllers.ActionResults.Test/BuildersTests/ActionResultsTests/ChallengeTests/ChallengeTestBuilderTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ public void PassingShouldThrowAnExceptionOnAnIncorrectAssertion()
167167
.Challenge(challenge => challenge
168168
.Passing(c => c.AuthenticationSchemes?.Count == 0));
169169
},
170-
$"When calling {nameof(MvcController.ChallengeWithAuthenticationSchemes)} " +
171-
$"action in {nameof(MvcController)} expected the ChallengeResult to pass the given predicate, but it failed.");
170+
$"When calling ChallengeWithAuthenticationSchemes action in MvcController expected the ChallengeResult to pass the given predicate, but it failed.");
172171
}
173172

174173
[Fact]

test/MyTested.AspNetCore.Mvc.Controllers.ActionResults.Test/BuildersTests/ActionResultsTests/ContentTests/ContentTestBuilderTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,7 @@ public void PassingShouldThrowAnExceptionOnAnIncorrectAssertion()
183183
.Content(content => content
184184
.Passing(c => c.Content == string.Empty));
185185
},
186-
$"When calling {nameof(MvcController.ContentAction)} " +
187-
$"action in {nameof(MvcController)} expected the ContentResult to pass the given predicate, but it failed.");
186+
$"When calling ContentAction action in MvcController expected the ContentResult to pass the given predicate, but it failed.");
188187
}
189188

190189
[Fact]

test/MyTested.AspNetCore.Mvc.Controllers.ActionResults.Test/BuildersTests/ActionResultsTests/FileTests/FileTestBuilderTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ public void PassingShouldThrowAnExceptionOnAnIncorrectAssertion()
226226
.File(file => file
227227
.Passing(f => f.FileName == string.Empty));
228228
},
229-
$"When calling {nameof(MvcController.FileWithVirtualPath)} " +
230-
$"action in {nameof(MvcController)} expected the VirtualFileResult to pass the given predicate, but it failed.");
229+
$"When calling FileWithVirtualPath action in MvcController expected the VirtualFileResult to pass the given predicate, but it failed.");
231230
}
232231

233232
[Fact]

test/MyTested.AspNetCore.Mvc.Controllers.ActionResults.Test/BuildersTests/ActionResultsTests/ForbidTests/ForbidTestBuilderTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ public void PassingShouldThrowAnExceptionOnAnIncorrectAssertion()
162162
.Forbid(forbid => forbid
163163
.Passing(f => f.AuthenticationSchemes?.Count == 0));
164164
},
165-
$"When calling {nameof(MvcController.ForbidWithAuthenticationSchemes)} " +
166-
$"action in {nameof(MvcController)} expected the ForbidResult to pass the given predicate, but it failed.");
165+
$"When calling ForbidWithAuthenticationSchemes action in MvcController expected the ForbidResult to pass the given predicate, but it failed.");
167166
}
168167

169168
[Fact]

test/MyTested.AspNetCore.Mvc.Controllers.ActionResults.Test/BuildersTests/ActionResultsTests/LocalRedirectTests/LocalRedirectTestBuilderTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ public void PassingShouldThrowAnExceptionOnAnIncorrectAssertion()
278278
.LocalRedirect(localRedirect => localRedirect
279279
.Passing(lr => lr.Url == string.Empty));
280280
},
281-
$"When calling {nameof(MvcController.LocalRedirectAction)} " +
282-
$"action in {nameof(MvcController)} expected the LocalRedirectResult to pass the given predicate, but it failed.");
281+
$"When calling LocalRedirectAction action in MvcController expected the LocalRedirectResult to pass the given predicate, but it failed.");
283282
}
284283

285284
[Fact]

test/MyTested.AspNetCore.Mvc.Controllers.ActionResults.Test/BuildersTests/ActionResultsTests/NotFoundTests/NotFoundTestBuilderTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,7 @@ public void PassingShouldThrowAnExceptionOnAnIncorrectAssertion()
453453
.NotFound(notFound => notFound
454454
.Passing(nf => nf.Formatters?.Count == 0));
455455
},
456-
$"When calling {nameof(MvcController.FullHttpNotFoundAction)} " +
457-
$"action in {nameof(MvcController)} expected the NotFoundObjectResult to pass the given predicate, but it failed.");
456+
$"When calling FullHttpNotFoundAction action in MvcController expected the NotFoundObjectResult to pass the given predicate, but it failed.");
458457
}
459458

460459
[Fact]

test/MyTested.AspNetCore.Mvc.Controllers.ActionResults.Test/BuildersTests/ActionResultsTests/ObjectTests/ObjectTestBuilderTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,7 @@ public void PassingShouldThrowAnExceptionOnAnIncorrectAssertion()
449449
.Object(obj => obj
450450
.Passing(o => o.Formatters?.Count == 0));
451451
},
452-
$"When calling {nameof(MvcController.FullObjectResultAction)} " +
453-
$"action in {nameof(MvcController)} expected the ObjectResult to pass the given predicate, but it failed.");
452+
$"When calling FullObjectResultAction action in MvcController expected the ObjectResult to pass the given predicate, but it failed.");
454453
}
455454

456455
[Fact]

test/MyTested.AspNetCore.Mvc.Controllers.ActionResults.Test/BuildersTests/ActionResultsTests/OkTests/OkTestBuilderTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,8 @@ public void PassingShouldThrowAnExceptionOnAnIncorrectAssertion()
449449
.ShouldReturn()
450450
.Ok(ok => ok
451451
.Passing(o => o.Formatters?.Count == 0));
452-
},
453-
$"When calling {nameof(MvcController.FullOkAction)} " +
454-
$"action in {nameof(MvcController)} expected the OkObjectResult to pass the given predicate, but it failed.");
452+
},
453+
$"When calling FullOkAction action in MvcController expected the OkObjectResult to pass the given predicate, but it failed.");
455454
}
456455

457456
[Fact]

test/MyTested.AspNetCore.Mvc.Controllers.ActionResults.Test/BuildersTests/ActionResultsTests/RedirectTests/RedirectTestBuilderTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,7 @@ public void PassingShouldThrowAnExceptionOnAnIncorrectAssertion()
568568
.Redirect(redirect => redirect
569569
.Passing(r => r.ActionName == string.Empty));
570570
},
571-
$"When calling {nameof(MvcController.RedirectToActionResult)} " +
572-
$"action in {nameof(MvcController)} expected the RedirectToActionResult to pass the given predicate, but it failed.");
571+
$"When calling RedirectToActionResult action in MvcController expected the RedirectToActionResult to pass the given predicate, but it failed.");
573572
}
574573

575574
[Fact]

0 commit comments

Comments
 (0)