Ejemplo n.º 1
0
        public void GenerateLinkDirectly_ReturnsNull_IfHelperRequestHasNoConfiguration()
        {
            HttpRequestMessage request    = new HttpRequestMessage(HttpMethod.Get, "http://localhost/vpath/prefix/Customers");
            ODataRoute         odataRoute = new ODataRoute("prefix", pathConstraint: null);

            Assert.Null(odataRoute.GenerateLinkDirectly(request, "odataPath"));
        }
Ejemplo n.º 2
0
        public void GenerateLinkDirectly_ReturnsNull_IfHelperRequestHasNoConfiguration()
        {
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/vpath/prefix/Customers");
            ODataRoute odataRoute = new ODataRoute("prefix", pathConstraint: null);

            Assert.Null(odataRoute.GenerateLinkDirectly(request, "odataPath"));
        }
Ejemplo n.º 3
0
        public void GenerateLinkDirectly_ReturnsNull_IfRouteTemplateHasParameterInPrefix()
        {
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/vpath/prefix/Customers");
            HttpConfiguration config = new HttpConfiguration(new HttpRouteCollection("http://localhost/vpath"));
            request.SetConfiguration(config);
            ODataRoute odataRoute = new ODataRoute("{prefix}", pathConstraint: null);

            Assert.Null(odataRoute.GenerateLinkDirectly(request, "odataPath"));
        }
Ejemplo n.º 4
0
        public void GenerateLinkDirectly_ReturnsNull_IfRouteTemplateHasParameterInPrefix()
        {
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/vpath/prefix/Customers");
            HttpConfiguration  config  = new HttpConfiguration(new HttpRouteCollection("http://localhost/vpath"));

            request.SetConfiguration(config);
            ODataRoute odataRoute = new ODataRoute("{prefix}", pathConstraint: null);

            Assert.Null(odataRoute.GenerateLinkDirectly(request, "odataPath"));
        }