Ejemplo n.º 1
0
        public void returns_expected_route_for_identifiable_resource(HttpVerbs expectedVerb, string expectedUrl)
        {
            var sut = new RouteHelper();

            var resource = new ResourceDefinition
            {
                ResourceName           = "Foo",
                ResourceIdentifierName = "Id"
            };

            var result = sut.GetRoutesFor(resource);

            Assert.Contains(
                expected: new Route(expectedVerb, expectedUrl),
                collection: result
                );
        }
Ejemplo n.º 2
0
        public void returns_expected_routes_for_non_identifiable_resource()
        {
            var sut = new RouteHelper();

            var resource = new ResourceDefinition
            {
                ResourceName = "Foo",
            };

            var result = sut.GetRoutesFor(resource);

            var expected = new[]
            {
                new Route(HttpVerbs.Get, "/foo"),
                new Route(HttpVerbs.Post, "/foo"),
            };

            Assert.Equal(expected, result);
        }