-
Notifications
You must be signed in to change notification settings - Fork 21
Implemented #46 #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Implemented #46 #48
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3d8d497
Added forgotten test.
AlexArchive 21c8637
Made ShouldRenderJson return JsonResult.
AlexArchive 0ea4632
Made ShouldReturnEmptyResult return EmptyResult.
AlexArchive 6eeb03c
Made ShouldGiveHttpStatus return HttpStatusCodeResult.
AlexArchive aaeaeec
Minor tweaks.
AlexArchive fb7d8f5
Bumped minor version.
AlexArchive File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Made ShouldGiveHttpStatus return HttpStatusCodeResult.
Partial implementation of #46.
- Loading branch information
commit 6eeb03c1f80ea3d1dd4d54d4b424bcd105929f7f
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using System.Net; | ||
using System.Web.Mvc; | ||
using NUnit.Framework; | ||
using TestStack.FluentMVCTesting.Tests.TestControllers; | ||
|
||
|
@@ -26,5 +27,35 @@ public void Check_for_invalid_http_status() | |
); | ||
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected HTTP status code to be '{0}', but instead received a '{1}'.", ControllerResultTestController.Code + 1, ControllerResultTestController.Code))); | ||
} | ||
|
||
[Test] | ||
public void Return_the_http_status_result() | ||
{ | ||
HttpStatusCodeResult expected = _controller.StatusCode(); | ||
HttpStatusCodeResult actual = _controller.WithCallTo(c => c.StatusCode()) | ||
.ShouldGiveHttpStatus(); | ||
Assert.AreEqual(expected.StatusCode, actual.StatusCode); | ||
Assert.AreEqual(expected.StatusDescription, actual.StatusDescription); | ||
} | ||
|
||
[Test] | ||
public void Reeturn_the_http_status_result_when_the_assertion_against_integer_is_true() | ||
{ | ||
HttpStatusCodeResult expected = _controller.StatusCode(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: The rest of the codebase uses |
||
HttpStatusCodeResult actual = _controller.WithCallTo(c => c.StatusCode()) | ||
.ShouldGiveHttpStatus(ControllerResultTestController.Code); | ||
Assert.AreEqual(expected.StatusCode, actual.StatusCode); | ||
Assert.AreEqual(expected.StatusDescription, actual.StatusDescription); | ||
} | ||
|
||
[Test] | ||
public void Reeturn_the_http_status_result_when_the_assertion_against_status_code_enum_is_true() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here :) |
||
{ | ||
HttpStatusCodeResult expected = _controller.StatusCode(); | ||
HttpStatusCodeResult actual = _controller.WithCallTo(c => c.StatusCode()) | ||
.ShouldGiveHttpStatus((HttpStatusCode) ControllerResultTestController.Code); | ||
Assert.AreEqual(expected.StatusCode, actual.StatusCode); | ||
Assert.AreEqual(expected.StatusDescription, actual.StatusDescription); | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/ee/e