コード例 #1
0
 public void DecodesUrlEncodedStrings()
 {
     var target = new FormDeserializer();
     FD actual;
     using (var s = new MemoryStream(Encoding.Default.GetBytes("Text=Hello+World!")))
     {
         actual = target.Read(s, typeof (FD)) as FD;
     }
     Assert.Equal("Hello World!", actual.Text);
 }
コード例 #2
0
 public void DecodesBase64String()
 {
     var target = new FormDeserializer();
     FD actual;
     using (var s = new MemoryStream(Encoding.Default.GetBytes("Text=NXqAP07hSjgGiTlyCCcMoAYt4%2BNNd3qGT45HFgqOK2bqL4my1QFuGjVVa4NEQ8hXjLJEA0BERl8tNpPwEBZRng%3D%3D")))
     {
         actual = target.Read(s, typeof (FD)) as FD;
     }
     Assert.Equal("NXqAP07hSjgGiTlyCCcMoAYt4+NNd3qGT45HFgqOK2bqL4my1QFuGjVVa4NEQ8hXjLJEA0BERl8tNpPwEBZRng==", actual.Text);
 }
コード例 #3
0
 public void DecodesUrlEncodedStrings()
 {
     var target = new FormDeserializer();
     FD actual;
     using (var s = new MemoryStream(Encoding.UTF8.GetBytes("Text=Hello+World!")))
     {
         actual = target.Read<FD>(s).Result;
     }
     Assert.Equal("Hello World!", actual.Text);
 }