コード例 #1
0
        public async void ReadsUpdatedServerList()
        {
            await isolatedStorageProvider.UpdateServerListAsync(new List <IPEndPoint>()
            {
                new IPEndPoint(IPAddress.Any, 1234),
                new IPEndPoint(IPAddress.Loopback, 4321)
            });

            var servers = await isolatedStorageProvider.FetchServerListAsync();

            Assert.Equal(2, servers.Count());
            Assert.Equal(IPAddress.Any, servers.First().Address);
            Assert.Equal(1234, servers.First().Port);

            await isolatedStorageProvider.UpdateServerListAsync(new List <IPEndPoint>());
        }
コード例 #2
0
        public async Task ReadsUpdatedServerList()
        {
            await isolatedStorageProvider.UpdateServerListAsync(new List <ServerRecord>()
            {
                ServerRecord.CreateSocketServer(new IPEndPoint(IPAddress.Any, 1234)),
                ServerRecord.CreateSocketServer(new IPEndPoint(IPAddress.Loopback, 4321))
            });

            var servers = await isolatedStorageProvider.FetchServerListAsync();

            Assert.Equal(2, servers.Count());
            Assert.Equal(IPAddress.Any.ToString(), servers.First().GetHost());
            Assert.Equal(1234, servers.First().GetPort());
            Assert.Equal(ProtocolTypes.Tcp | ProtocolTypes.Udp, servers.First().ProtocolTypes);

            await isolatedStorageProvider.UpdateServerListAsync(new List <ServerRecord>());
        }