public void CannotReuseServiceNames()
        {
            var registrar   = new BindingRegistrar();
            var serviceName = "repeat-me";

            registrar.RegisterRandom(serviceName, new Uri("http://first-time"));
            Action action = () => registrar.RegisterRoundRobin(serviceName, new Uri("http://second-time"));

            action.Should().Throw <ArgumentException>().WithMessage("Service name is already registered*");
        }
        public void AtLeastOneUriRequired()
        {
            var registrar = new BindingRegistrar();

            foreach (var action in new Action[]
            {
                () => registrar.RegisterRandom("random"),
                () => registrar.RegisterRoundRobin("round-robin"),
                () => registrar.RegisterAdaptive("adaptive", uri => 0),
                () => registrar.RegisterUpdateableAdaptive("updateable", uri => 1)
            })
            {
                action.Should().Throw <ArgumentException>().WithMessage("You must provide at least one URI to load balance*");
            }
        }
        public void HostNameIsRequired()
        {
            var registrar = new BindingRegistrar();
            var testUri   = new Uri("http://localhost");

            foreach (var action in new Action[]
            {
                () => registrar.RegisterRandom(null, testUri),
                () => registrar.RegisterRoundRobin(null, testUri),
                () => registrar.RegisterAdaptive(null, uri => 0, testUri),
                () => registrar.RegisterUpdateableAdaptive(null, uri => 1, testUri)
            })
            {
                action.Should().Throw <ArgumentNullException>();
            }
        }