Esempio n. 1
0
        public async Task GotRequest_UsingGetStringAsnyc_ReturnMustEquanWant()
        {
            var addr    = "dsajifbagviufvdi2ud";
            var adapter = new NullNetworkAdapter();
            var str     = await NetworkAdapterExtensions.GetStringAsync(adapter, new RequestSettings { Address = addr });

            Assert.AreEqual(addr, str);
        }
Esempio n. 2
0
        public async Task GotRequest_UsingGetObjectAsnyc_ReturnMustBeAObject()
        {
            var stu = new Student {
                Name = "hello", Age = 22
            };
            var addr    = JsonHelper.Serialize(stu);
            var adapter = new NullNetworkAdapter();
            var str     = await NetworkAdapterExtensions.GetObjectAsync <Student>(adapter, new RequestSettings { Address = addr });

            Assert.IsNotNull(str);
            Assert.AreEqual(stu.Name, str.Name);
            Assert.AreEqual(stu.Age, str.Age);
        }