public void GivenNullFactoryWhenSetClientFactoryCalledThenShouldThrowArgumentNull()
        {
            var target = new ClientHttpConfiguration();

            Assert.Throws <ArgumentNullException>(
                () => target.SetClientFactory(null));
        }
        public void GivenValidPathTemplateWhenSetPathTemplateCalledThenShouldSetPathTemplate(
            string path)
        {
            var target = new ClientHttpConfiguration();

            target.SetPathTemplate(path);
            Assert.Equal(path, target.PathTemplate);
        }
        public void GivenInvalidPathTemplateWhenSetPathTemplateCalledThenShouldThrowArgument(
            string path)
        {
            var target = new ClientHttpConfiguration();

            Assert.Throws <ArgumentException>(
                () => target.SetPathTemplate(path));
        }
        public void SetsAppropriateDefaults()
        {
            var target = new ClientHttpConfiguration();

            Assert.Equal("/efcore/{context}/{collection}", target.PathTemplate);
            Assert.NotNull(target.ClientFactory);
            Assert.Throws <InvalidOperationException>(
                () => target.ClientFactory());
        }
        public void GivenFactoryWhenSetClientFactoryCalledThenShouldSetFactory()
        {
            var target = new ClientHttpConfiguration();
            var client = new RemoteQueryClient(new HttpClient());

            target.SetClientFactory(() => client);
            var actual = target.ClientFactory();

            Assert.Same(client, actual);
        }