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
routes.MapRoute( | |
name: "AdminCategories", | |
url: "Admin/Categories", | |
defaults: new { controller = "Admin", action = "Categories" } | |
); |
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
Given I click the "Add category" button |
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
[Given(@"I click the ""(.*)"" button")] | |
public void GivenIClickTheButton(string p0) | |
{ | |
BrowserSession.ClickLink("Register"); | |
} |
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
[Given(@"I am an admin user and I have logged in")] | |
public void GivenIAmAnAdminUserAndIHaveLoggedIn() | |
{ | |
//todo: come back to this | |
} | |
[Given(@"I have navigated to the manage categories screen")] | |
public void GivenIHaveNavigatedToTheManageCategoriesScreen() | |
{ | |
BrowserSession.Visit("http://localhost:4334/admin/categories"); |
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
[Test] | |
public void When_requesting_the_admin_categories__add_post_page_result_is_correct() | |
{ | |
var controller = new AdminController(); | |
var viewModel = new CategoriesAddViewModel(); | |
var result = controller.Categories(viewModel); | |
result.Should().BeAssignableTo<ActionResult>(); | |
} |
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
<a href="/admin/categories">Add category</a> |
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
[Test] | |
public void When_navigating_to_manage_categories_add_url_result_is_correct() | |
{ | |
const string expectedAction = "add"; | |
const string expectedController = "Admin"; | |
const string url = "~/admin/categories/add"; | |
var result = GetRouteData(url); | |
result.Values["Action"].Should().Be(expectedAction); | |
result.Values["Controller"].Should().Be(expectedController); | |
} |
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
routes.MapRoute( | |
name: "AdminCategoriesAdd", | |
url: "Admin/Categories/Add", | |
defaults: new { controller = "Admin", action = "CategoriesAdd" } | |
); |
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
<input type="text" name="CategoryName" id="CategoryName"/> |
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
<form method="POST" action="/admin/categories/add"> | |
<input type="text" name="CategoryName" id="CategoryName" /> | |
<input type="checkbox" name="Enabled" id="Enabled" /> | |
<input type="submit" name="Save" id="Save" value="Save" /> | |
</form> |