示例#1
0
        public void SelectServer_ReturnsServerFroMappingTable()
        {
            ServerConfig[] servers = CreateServers(1);
            ClusterConfig  config  = new ClusterConfig {
                Servers = servers
            };

            ServerProvider provider       = new ServerProvider(config);
            ServerConfig   selectedServer = provider.SelectServer(GetHashCode());

            Assert.Equal(selectedServer, servers[0]);
        }
示例#2
0
        public void SelectServer_ReturnsServerFroMappingTable()
        {
            var first = new ServerConfig
            {
                Ip   = "192.168.0.1",
                Port = 5000
            };

            ClusterConfig config = new ClusterConfig
            {
                Servers = new[] { first }
            };


            ServerProvider provider       = new ServerProvider(config);
            ServerConfig   selectedServer = provider.SelectServer(GetHashCode());

            Assert.Equal(selectedServer, first);
        }