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

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

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

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

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

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