示例#1
0
        public void ShouldConvertToStringWithBullet()
        {
            Reduce predicate;

            predicate = new Reduce();

            Assert.AreEqual("•;", predicate.ToString(predicate));
        }
示例#2
0
        public IEnumerable <KeyValuePair <string, string> > ToKeyValues()
        {
            if (IncludeDocs)
            {
                yield return(new KeyValuePair <string, string>("include_docs", IncludeDocs.ToString().ToLower()));
            }

            if (Descending)
            {
                yield return(new KeyValuePair <string, string>("descending", Descending.ToString().ToLower()));
            }

            if (!Reduce)
            {
                yield return(new KeyValuePair <string, string>("reduce", Reduce.ToString().ToLower()));
            }

            if (!InclusiveEnd)
            {
                yield return(new KeyValuePair <string, string>("inclusive_end", InclusiveEnd.ToString().ToLower()));
            }

            if (UpdateSeq)
            {
                yield return(new KeyValuePair <string, string>("update_seq", UpdateSeq.ToString().ToLower()));
            }

            if (Group)
            {
                yield return(new KeyValuePair <string, string>("group", Group.ToString().ToLower()));
            }

            if (HasValue(GroupLevel))
            {
                yield return(new KeyValuePair <string, string>("group_level", GroupLevel.ToString()));
            }

            if (HasValue(Stale))
            {
                yield return(new KeyValuePair <string, string>("stale", FormatValue(Stale)));
            }

            if (HasValue(Key))
            {
                yield return(new KeyValuePair <string, string>("key", FormatValue(Key)));
            }

            if (HasValue(Keys))
            {
                yield return(new KeyValuePair <string, string>("keys", FormatValue(Keys)));
            }

            if (HasValue(StartKey))
            {
                yield return(new KeyValuePair <string, string>("startkey", FormatValue(StartKey)));
            }

            if (HasValue(StartKeyDocId))
            {
                yield return(new KeyValuePair <string, string>("startkey_docid", FormatValue(StartKeyDocId)));
            }

            if (HasValue(EndKey))
            {
                yield return(new KeyValuePair <string, string>("endkey", FormatValue(EndKey)));
            }

            if (HasValue(EndKeyDocId))
            {
                yield return(new KeyValuePair <string, string>("endkey_docid", FormatValue(EndKeyDocId)));
            }

            if (HasValue(Limit))
            {
                yield return(new KeyValuePair <string, string>("limit", Limit.ToString()));
            }

            if (HasValue(Skip))
            {
                yield return(new KeyValuePair <string, string>("skip", Skip.ToString()));
            }
        }