Ejemplo n.º 1
0
        public void Parse_uri_with_path_that_ends_with_slash_throws_format_exception()
        {
            // Given
            const string uri = "http://nancyfx.org/rels/";

            // When
            var exception = Assert.Throws <FormatException>(() => HttpLinkRelation.Parse(uri));

            // Then
            exception.Message.ShouldContain(uri);
        }
Ejemplo n.º 2
0
        public void Parse_relative_value_should_return_iana_prefixed_link_relation()
        {
            // Given
            const string relation = "alternate";

            // When
            var rel = HttpLinkRelation.Parse(relation);

            // Then
            rel.ShouldNotBeNull();
            rel.Prefix.ShouldEqual(HttpLinkRelation.IanaLinkRelationPrefix);
            rel.Value.ShouldEqual(relation);
        }
Ejemplo n.º 3
0
        public void Parse_uri_should_return_link_relation()
        {
            // Given
            const string relation = "http://nancyfx.org/rels/something";

            // When
            var rel = HttpLinkRelation.Parse(relation);

            // Then
            rel.ShouldNotBeNull();
            rel.Prefix.ShouldEqual(new Uri("http://nancyfx.org/rels/"));
            rel.Value.ShouldEqual("something");
        }