Пример #1
0
        public async Task RandomSelector_Test()
        {
            var moq = new ConsulRandomAddressSelector();

            var result = await moq.SelectAsync(new AddressSelectContext()
            {
                Address = new List <AddressModel>()
                {
                    new IpAddressModel()
                    {
                        Ip   = "127.0.0.1",
                        Port = 8500
                    },
                    new IpAddressModel()
                    {
                        Ip   = "192.168.3.11",
                        Port = 8500
                    }
                },
                //Descriptor = new ServiceDescriptor()
                //{
                //    Id = Guid.NewGuid().ToString("N"),
                //}
            });

            Assert.NotNull(result);
        }
Пример #2
0
        public async Task RandomSelector_Test()
        {
            var moq = new ConsulRandomAddressSelector();

            var result = await moq.SelectAsync(new AddressSelectContext()
            {
                Address = new List <AddressModel>()
                {
                    new IpAddressModel()
                    {
                        Ip   = "127.0.0.1",
                        Port = 8500
                    },
                    new IpAddressModel()
                    {
                        Ip   = "192.168.3.11",
                        Port = 8500
                    }
                },
            });

            Assert.NotNull(result);
        }