Пример #1
0
 public void ctor_OneElement_EqualSeparatedKeyValue()
 {
     var subject = new QueryBuilder(new NameValueCollection { { "a", "b" } });
     Assert.That(subject.Query, Is.EqualTo("a=b"));
 }
Пример #2
0
 public void ctor_TwoElement_EqualSeparatedKeyValuesTokenizedByAmpersand()
 {
     var subject = new QueryBuilder(new NameValueCollection { { "a", "b" }, {"c", "d"} });
     Assert.That(subject.Query, Is.EqualTo("a=b&c=d"));
 }
Пример #3
0
 public void Ctor_NullCollection_EmptyQuery()
 {
     var subject = new QueryBuilder((NameValueCollection)null);
     Assert.That(subject.Query, Is.Empty);
 }
Пример #4
0
        public void Ctor_EncodableValues_GetEncoded()
        {
            var subject = new QueryBuilder(new NameValueCollection { { "a", "b&b" } });

            Assert.That(subject.Query, Is.EqualTo("a=b%26b"));
        }
Пример #5
0
 public void Ctor_EmptyCollection_EmptyQuery()
 {
     var subject = new QueryBuilder(new NameValueCollection());
     Assert.That(subject.Query, Is.Empty);
 }
Пример #6
0
 public void Ctor_EmmptyKeys_AreNotAdded()
 {
     var subject = new QueryBuilder(new NameValueCollection { { "a", "b" }, { null, "d" } });
     Assert.That(subject.Query, Is.EqualTo("a=b"));
 }
Пример #7
0
 public override byte[] GetPreloadedEntityBody()
 {
     QueryBuilder query = new QueryBuilder(_form);
     return Encoding.UTF8.GetBytes(query.Query);
 }