Esempio n. 1
0
        public async Task GetWhoisRawAsync_ValidParameters_ExpectedResult()
        {
            IUKFastRegistrarClient client = Substitute.For <IUKFastRegistrarClient>();

            client.GetAsync <string>("/registrar/v1/whois/ukfast.co.uk/raw").Returns("rawwhois");

            var ops   = new WhoisOperations <Whois>(client);
            var whois = await ops.GetWhoisRawAsync("ukfast.co.uk");

            Assert.AreEqual("rawwhois", whois);
        }
Esempio n. 2
0
        public async Task GetWhoisRawAsync_InvalidDomainName_ThrowsUKFastClientValidationException()
        {
            var ops = new WhoisOperations <Whois>(null);

            await Assert.ThrowsExceptionAsync <UKFastClientValidationException>(() => ops.GetWhoisRawAsync(""));
        }