public void AddToBlacklist_should_add_blacklist()
        {
            var properties  = new TestApplicationInfoProperties();
            var addReplicas = new[]
            {
                new Uri("http://replica:1/vostok"),
                new Uri("http://replica:2/vostok"),
                new Uri("http://replica:3/vostok")
            };

            var updated = properties.AddToBlacklist(addReplicas);

            updated.GetBlacklist().Should().BeEquivalentTo(addReplicas);
        }
        public void RemoveFromBlacklist_should_not_change_blacklist_if_replicas_already_not_present()
        {
            var properties   = new TestApplicationInfoProperties();
            var initReplicas = new[]
            {
                new Uri("http://replica:4/vostok")
            };
            var withBlacklist = properties.AddToBlacklist(initReplicas);

            var removeReplicas = new[]
            {
                new Uri("http://replica:1/vostok"),
                new Uri("http://replica:2/vostok"),
                new Uri("http://replica:3/vostok")
            };

            var updated = withBlacklist.RemoveFromBlacklist(removeReplicas);

            updated.GetBlacklist().Should().BeEquivalentTo(new Uri("http://replica:4/vostok"));
        }
        public void AddToBlacklist_should_add_new_replicas_to_existent_blacklist()
        {
            var properties   = new TestApplicationInfoProperties();
            var initReplicas = new[]
            {
                new Uri("http://replica:1/vostok"),
                new Uri("http://replica:2/vostok"),
                new Uri("http://replica:3/vostok")
            };
            var withBlacklist  = properties.AddToBlacklist(initReplicas);
            var updateReplicas = new[]
            {
                new Uri("http://replica:4/vostok"),
                new Uri("http://replica:5/vostok"),
                new Uri("http://replica:6/vostok")
            };

            var updated = withBlacklist.AddToBlacklist(updateReplicas);

            updated.GetBlacklist().Should().BeEquivalentTo(initReplicas.Concat(updateReplicas));
        }