Esempio n. 1
0
        public void EmptyHosts()
        {
            var pm = new PartitionMap {
                PartitionCount = 3, Hosts = Array.Empty <PartitionHostMap>()
            };

            var(ok, err) = pm.Validate();
            Assert.False(ok);
        }
Esempio n. 2
0
        public void DuplicatePartitions()
        {
            var pm = new PartitionMap
            {
                PartitionCount = 3,
                Hosts          = new[]
                {
                    new PartitionHostMap {
                        Host = "localhost", Port = 5432, Partitions = new[] { 1, 2, 2 }
                    }
                }
            };

            var(ok, err) = pm.Validate();
            Assert.False(ok);
        }
Esempio n. 3
0
        public void Correct()
        {
            var pm = new PartitionMap
            {
                PartitionCount = 3,
                Hosts          = new[]
                {
                    new PartitionHostMap {
                        Host = "localhost", Port = 5432, Partitions = new[] { 1, 2 }
                    },
                    new PartitionHostMap {
                        Host = "localhost", Port = 5433, Partitions = new[] { 3 }
                    }
                }
            };

            var(ok, err) = pm.Validate();
            Assert.True(ok);
        }