public void IsPageShortNameRegistered_WhenSuppliedUnknownDomain_ThrowsException(WireDataFormat format)
        {
            var client = TestContext.CreateClientInvalidCredentials(format);
            var pageClient = new PageApi(client.HttpChannel);
            const string unknownDomain = "unknownDomain.justgiving.com";

            var exception = Assert.Throws<ErrorResponseException>(() => pageClient.IsPageShortNameRegistered("rasha25", unknownDomain));

            Assert.That(exception.Response.StatusCode, Is.EqualTo(HttpStatusCode.BadRequest));

        }
        public void IsPageShortNameRegistered_WhenSuppliedPageNameUnlikelyToExist_ReturnsFalse(WireDataFormat format)
        {
            var client = TestContext.CreateClientInvalidCredentials(format);
            var pageClient = new PageApi(client.HttpChannel);

            var exists = pageClient.IsPageShortNameRegistered(Guid.NewGuid().ToString());

            Assert.IsFalse(exists);
        }
        public void IsPageShortNameRegistered_WhenSuppliedPageNameUnlikelyToExistOnNonDefaultDomain_ReturnsFalse(WireDataFormat format)
        {
            //arrange
            var client = TestContext.CreateClientInvalidCredentials(format);
            var pageClient = new PageApi(client.HttpChannel);

            //act
            var exists = pageClient.IsPageShortNameRegistered("rasha25", TestConfigurationsHelper.GetProperty<ITestConfigurations, string>(x => x.RflDomain));

            //assert
            Assert.IsFalse(exists);
        }
        public void IsPageShortNameRegistered_WhenSuppliedKnownExistingPage_ReturnsTrue(WireDataFormat format)
        {
            var client = TestContext.CreateClientInvalidCredentials(format);
            var pageClient = new PageApi(client.HttpChannel);

            var exists = pageClient.IsPageShortNameRegistered("rasha25");

            Assert.IsTrue(exists);
        }