Пример #1
0
        public static string ToXmlContent(this ConnectionTypeInfo source)
        {
            var sb = new StringBuilder();

            sb.AppendHeader();
            sb.AppendValue("New" + nameof(source.ConnectionType), source.ConnectionType);
            sb.AppendValue("New" + nameof(source.PossibleConnectionTypes), source.PossibleConnectionTypes);
            sb.AppendFooter();
            return(sb.ToString());
        }
Пример #2
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();
        }