public void AddsPrefix() { var target = new DefaultUrlPathBuilder("my-prefix"); var result = target.BuildCanonicalPath(Resource); _output.WriteLine(result); Assert.StartsWith("/my-prefix/", result); result = target.BuildCanonicalPath(Resource, Id); _output.WriteLine(result); Assert.StartsWith("/my-prefix/", result); result = target.BuildRelationshipPath(Resource, Id, Relationship); _output.WriteLine(result); Assert.StartsWith("/my-prefix/", result); result = target.BuildRelationshipPath(Resource, Id, Relationship, Id); _output.WriteLine(result); Assert.StartsWith("/my-prefix/", result); }
public void GivesCorrectResults() { var target = new DefaultUrlPathBuilder(); var result = target.BuildCanonicalPath(Resource); _output.WriteLine(result); Assert.Equal("/people/", result); result = target.BuildCanonicalPath(Resource, Id); _output.WriteLine(result); Assert.Equal("/people/123/", result); result = target.BuildRelationshipPath(Resource, Id, Relationship); _output.WriteLine(result); Assert.Equal("/people/123/relationships/job/", result); result = target.BuildRelationshipPath(Resource, Id, Relationship, Id); _output.WriteLine(result); Assert.Equal("/people/123/job/", result); }