Beispiel #1
0
 public void WhenBreachNameIsNull_ThenThrowException()
 {
     Assert.Throws <ArgumentException>(() => HibpUriFactory.CreateBreachSiteByNameUri(null));
 }
Beispiel #2
0
            public void WhenDomainIsNull_ThenReturnUriWithoutDomainParam()
            {
                var result = HibpUriFactory.CreateBreachedSiteUri(null);

                Assert.That(result.ToString(), Is.EqualTo(ExpectedUrl()));
            }
Beispiel #3
0
            public void WhenDomainIsSpecified_ThenReturnUriWithDomain()
            {
                var result = HibpUriFactory.CreateBreachedSiteUri("yahoo.com");

                Assert.That(result.ToString(), Is.EqualTo(ExpectedUrl() + "?domain=yahoo.com"));
            }
Beispiel #4
0
            public void WhenEmailAddressSupplied_ThenReturnUriWithEmailAddress()
            {
                var result = HibpUriFactory.CreateAccountPastesUri(EmailAddress);

                Assert.That(result.ToString(), Is.EqualTo($"{UrlBase}{ServicePath}{_emailAddressUrlEncoded}"));
            }
Beispiel #5
0
 private static Uri Act(string emailAddress, HibpRequestOptions options = null)
 {
     return(HibpUriFactory.CreateBreachedAccountUri(emailAddress, options));
 }
Beispiel #6
0
 public void WhenEmailAddressIsEmpty_ThenThrowException()
 {
     Assert.Throws <ArgumentException>(() => HibpUriFactory.CreateAccountPastesUri(string.Empty));
 }
Beispiel #7
0
 public void WhenEmailAddressIsNull_ThenThrowException()
 {
     Assert.Throws <ArgumentException>(() => HibpUriFactory.CreateAccountPastesUri(null));
 }
Beispiel #8
0
            public void WhenCalled_ThenReturnsUri()
            {
                var result = HibpUriFactory.CreateDataClassesUri();

                Assert.That(result.ToString(), Is.EqualTo($"{UrlBase}{ServicePath}"));
            }
Beispiel #9
0
            public void WhenBreachNameSupplied_ThenReturnUriWithBreachName()
            {
                var result = HibpUriFactory.CreateBreachSiteByNameUri("000webhost");

                Assert.That(result.ToString(), Is.EqualTo(ExpectedUrl() + "/000webhost"));
            }
Beispiel #10
0
 public void WhenBreachNameIsEmpty_ThenThrowException()
 {
     Assert.Throws <ArgumentException>(() => HibpUriFactory.CreateBreachSiteByNameUri(string.Empty));
 }