Exemplo n.º 1
0
    public void Should_Get_Request_From_Route_Table()
    {
        //Arrange
        var contextBase = HttpContext.Current.Request.RequestContext.HttpContext;
        var routes      = RouteTable.Routes;
        var sut         = new RouteInspector(routes, contextBase);
        //Act
        var actual = sut.RequestIsInRoutes();

        //Assert
        Assert.IsTrue(actual);
    }
Exemplo n.º 2
0
    public void Should_Get_Request_From_Route_Table()
    {
        //Arrange
        var contextBase = new Mock <IHttpContextAccessor>();

        contextBase.Setup(m => m.HttpContext)
        .Returns(HttpContext.Current.Request.RequestContext.HttpContext);
        var routeTable = new Mock <IRouteTable>();

        routeTable.Setup(m => m.Routes).Returns(RouteTable.Routes);
        var sut = new RouteInspector(routeTable.Object, contextBase.Object);
        //Act
        var actual = sut.RequestIsInRoutes();

        //Assert
        Assert.IsTrue(actual);
    }