Пример #1
0
        public async Task GetConnectionTypeInfoAsync_Test1()
        {
            var expected = new ConnectionTypeInfo
            {
                ConnectionType          = ConnectionType.IP_Routed,
                PossibleConnectionTypes = PossibleConnectionTypes.IP_Routed | PossibleConnectionTypes.IP_Bridged,
            };

            {
                var s = expected.ToXmlContent();
            }

            var handler = new FakeHandler();

            handler.Sending += (s, e) => { e.Response.Content = new StringContent(expected.ToXmlContent()); };

            var clt    = new WANPPPConnectionClient("https://fritz.box:453", 5000, handler);
            var actual = await clt.GetConnectionTypeInfoAsync();
        }
Пример #2
0
        public async Task GetStatusInfoAsync_Test1()
        {
            var expected = new ConnectionStatusInfo
            {
                ConnectionStatus    = ConnectionStatus.Connected,
                LastConnectionError = ConnectionError.ERROR_NONE,
                Uptime = 1000,
            };
            var handler = new FakeHandler();

            handler.Sending += (s, e) => { e.Response.Content = new StringContent(expected.ToXmlContent()); };

            var clt    = new WANPPPConnectionClient("https://fritz.box", 5000, handler);
            var actual = await clt.GetStatusInfoAsync();

            Assert.Equal(expected.ConnectionStatus, actual.ConnectionStatus);
            Assert.Equal(expected.LastConnectionError, actual.LastConnectionError);
            Assert.Equal(expected.Uptime, actual.Uptime);
        }
 public WANPPPConnectionClientHandler(ConnectionSettings settings, Action <string> printOutput, Func <string> getInput, Action wait, Action clearOutput) : base(settings, printOutput, getInput, wait, clearOutput)
 {
     _client = new WANPPPConnectionClient(settings);
 }
 public WANPPPConnectionClientHandler(FritzDevice device, Action <string> printOutput, Func <string> getInput, Action wait, Action clearOutput) : base(device, printOutput, getInput, wait, clearOutput)
 {
     _client = device.GetServiceClient <WANPPPConnectionClient>();
 }