public void WhenBreachNameIsNull_ThenThrowException() { Assert.Throws <ArgumentException>(() => HibpUriFactory.CreateBreachSiteByNameUri(null)); }
public void WhenDomainIsNull_ThenReturnUriWithoutDomainParam() { var result = HibpUriFactory.CreateBreachedSiteUri(null); Assert.That(result.ToString(), Is.EqualTo(ExpectedUrl())); }
public void WhenDomainIsSpecified_ThenReturnUriWithDomain() { var result = HibpUriFactory.CreateBreachedSiteUri("yahoo.com"); Assert.That(result.ToString(), Is.EqualTo(ExpectedUrl() + "?domain=yahoo.com")); }
public void WhenEmailAddressSupplied_ThenReturnUriWithEmailAddress() { var result = HibpUriFactory.CreateAccountPastesUri(EmailAddress); Assert.That(result.ToString(), Is.EqualTo($"{UrlBase}{ServicePath}{_emailAddressUrlEncoded}")); }
private static Uri Act(string emailAddress, HibpRequestOptions options = null) { return(HibpUriFactory.CreateBreachedAccountUri(emailAddress, options)); }
public void WhenEmailAddressIsEmpty_ThenThrowException() { Assert.Throws <ArgumentException>(() => HibpUriFactory.CreateAccountPastesUri(string.Empty)); }
public void WhenEmailAddressIsNull_ThenThrowException() { Assert.Throws <ArgumentException>(() => HibpUriFactory.CreateAccountPastesUri(null)); }
public void WhenCalled_ThenReturnsUri() { var result = HibpUriFactory.CreateDataClassesUri(); Assert.That(result.ToString(), Is.EqualTo($"{UrlBase}{ServicePath}")); }
public void WhenBreachNameSupplied_ThenReturnUriWithBreachName() { var result = HibpUriFactory.CreateBreachSiteByNameUri("000webhost"); Assert.That(result.ToString(), Is.EqualTo(ExpectedUrl() + "/000webhost")); }
public void WhenBreachNameIsEmpty_ThenThrowException() { Assert.Throws <ArgumentException>(() => HibpUriFactory.CreateBreachSiteByNameUri(string.Empty)); }