This file contains 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
Feature: Manage Product Categories | |
In order to group products by categories | |
As an admin of the site | |
I want to be able to manage categories in the system | |
Background: | |
Given I am an admin user and I have logged in | |
And I have navigated to the manage categories screen | |
@UI |
This file contains 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
using System; | |
using Coypu; | |
using TechTalk.SpecFlow; | |
namespace BrightonSausageCoEcommsBehaviors.Specs | |
{ | |
[Binding] | |
public class ManageProductCategoriesSteps | |
{ | |
public BrowserSession BrowserSession |
This file contains 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
public BrowserSession BrowserSession | |
{ | |
get | |
{ | |
if (FeatureContext.Current.ContainsKey("BrowserSession")) | |
{ | |
return (BrowserSession)FeatureContext.Current["BrowserSession"]; | |
} | |
var sessionConfiguration = new SessionConfiguration |
This file contains 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
BrowserSession.Visit("http://localhost:4334//admin/categories"); |
This file contains 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
private static RouteData GetRouteData(string url) | |
{ | |
var routes = new RouteCollection(); | |
RouteConfig.RegisterRoutes(routes); | |
var httpContextMock = new Mock<HttpContextBase>(); | |
httpContextMock.Setup(c => c.Request.AppRelativeCurrentExecutionFilePath) | |
.Returns(url); | |
return routes.GetRouteData(httpContextMock.Object); |
This file contains 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
const string expectedAction = "categories"; |
This file contains 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
const string expectedAction = "categories"; |
This file contains 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
var result = GetRouteData(url); |
This file contains 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
const string url = "~/admin/categories"; |
This file contains 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
[TestFixture] | |
public class AdminRoutingBehaviors | |
{ | |
[Test] | |
public void When_navigating_to_manage_categories_url_result_is_correct() | |
{ | |
const string expectedAction = "categories"; | |
const string expectedController = "Admin"; | |
const string url = "~/admin/categories"; | |
var result = GetRouteData(url); |