public void GetSlugFromRequest_WithoutSlugInRouteData_ReturnsNull() { // arrange var routeData = new RouteData(); var requestContext = new RequestContext(new Mock<HttpContextBase>().Object, routeData); // act string slug = requestContext.GetSlugFromRequest(); // assert Assert.IsNull(slug); }
public void GetSlugFromRequest_WithSlugInRouteData_ReturnsSlug() { // arrange var routeData = new RouteData(); routeData.Values.Add("slug", "my-category"); var requestContext = new RequestContext(new Mock<HttpContextBase>().Object, routeData); // act string slug = requestContext.GetSlugFromRequest(); // assert Assert.AreEqual("my-category", slug); }