public void HateoasLink_UriSelf_NullHref_ThrowsException() { Uri href = null; _ = Assert.Throws <ArgumentNullException>( () => HateoasLink.Self(href)); }
public void HateoasLink_UriSelf_SetsHref() { Uri href = new Uri("https://www.example.com/"); var link = HateoasLink.Self(href); Assert.Equal(href, link.Href); }
public void HateoasLink_StringSelf_SetsHref() { string href = "https://www.example.com/"; var link = HateoasLink.Self(href); Assert.Equal(href, link.Href.AbsoluteUri); }
public void HateoasLink_Self_SerializedJson_ContainsNecessaryData( string href, string contains) { var link = HateoasLink.Self(href); var serialized = link.ToJson(); Assert.Contains(contains, serialized); }
public void HateoasLink_UriSelf_RelIsSelf() { Uri href = new Uri("https://www.example.com/"); const string self = "self"; var link = HateoasLink.Self(href); Assert.Equal(self, link.Rel); }
public void HateoasLink_StringSelf_RelIsSelf() { string href = "https://www.example.com/"; const string self = "self"; var link = HateoasLink.Self(href); Assert.Equal(self, link.Rel); }
public void HateoasLink_StringSelf_NonUriHref_ThrowsException( string href) { _ = Assert.Throws <UriFormatException>( () => HateoasLink.Self(href)); }