public void Parse_StringUrlIsBad() { var expected = "</Testing>"; Action action = () => HeaderLinkUrl.Parse(expected); action.Should().Throw <FormatException>(); }
public void Parse_StringUrlIsValid() { var expected = "http://www.google.com"; var actual = HeaderLinkUrl.Parse($"<{expected}>"); actual.Url.ToString().TrimEnd('/').Should().BeEquivalentTo(expected.TrimEnd('/')); }
public void Parse_StringUrlWithMultipleRelation() { var expectedUrl = "http://www.google.com"; var expectedRelations = new[] { StandardLinkTypes.Next, StandardLinkTypes.Alternate }; var actual = HeaderLinkUrl.Parse($"<{expectedUrl}>;rel=\"{String.Join(" ", expectedRelations)}\""); actual.Url.ToString().TrimEnd('/').Should().BeEquivalentTo(expectedUrl.TrimEnd('/')); actual.Relations.Should().Contain(expectedRelations); }
public void Parse_StringUrlWithRelation() { var expectedUrl = "http://www.google.com"; var expectedRelation = "next"; var actual = HeaderLinkUrl.Parse($"<{expectedUrl}>;rel=\"{expectedRelation}\""); actual.Url.ToString().TrimEnd('/').Should().BeEquivalentTo(expectedUrl.TrimEnd('/')); actual.Relation.Should().Be(expectedRelation); }
public void Parse_StringUrlIsBadFormat() { Action action = () => HeaderLinkUrl.Parse(@"D:\/\Temp\/f\test.dat"); action.Should().Throw <FormatException>(); }
public void Parse_StringUrlIsEmpty() { Action action = () => HeaderLinkUrl.Parse(""); action.Should().Throw <ArgumentException>(); }
public void Parse_StringUrlIsNull() { Action action = () => HeaderLinkUrl.Parse((string)null); action.Should().Throw <ArgumentNullException>(); }