コード例 #1
0
        public void Count_SingleItemInCollection_ReturnsOne()
        {
            var nvc = new DataDictionary();
            var rdd = new RequestDataDictionary();

            nvc.Add("foobar", "baz");
            rdd.AddCollection(nvc);

            Assert.AreEqual(1, rdd.Count);
        }
コード例 #2
0
        public void Clear_ItemInCollection_SetsCountZero()
        {
            var nvc = new DataDictionary();
            var rdd = new RequestDataDictionary();

            nvc.Add("foobar", "baz");
            rdd.AddCollection(nvc);

            rdd.Clear();
            Assert.AreEqual(0, rdd.Count);
        }
コード例 #3
0
        public void Count_ItemInCollectionAndItemAdded_ReturnsTwo()
        {
            var nvc = new DataDictionary();
            var rdd = new RequestDataDictionary();

            nvc.Add("foobar", "baz");
            rdd.AddCollection(nvc);
            rdd.Add("foobar", "baz");

            Assert.AreEqual(2, rdd.Count);
        }
コード例 #4
0
        public void Clear_ItemInCollection_SetsCountZero()
        {
            var nvc = new DataDictionary ();
            var rdd = new RequestDataDictionary ();

            nvc.Add ("foobar", "baz");
            rdd.AddCollection (nvc);

            rdd.Clear ();
            Assert.AreEqual (0, rdd.Count);
        }
コード例 #5
0
        public void ContainsKey_ItemInCollection_ReturnsTrue()
        {
            var nvc = new DataDictionary();
            var rdd = new RequestDataDictionary();

            nvc.Add("foobar", "baz");
            rdd.AddCollection(nvc);

            bool has_item = rdd.ContainsKey("foobar");

            Assert.IsTrue(has_item);
        }
コード例 #6
0
        public void Contains_ItemInCollectionKeyAndValuesMatch_ReturnsTrue()
        {
            var nvc  = new DataDictionary();
            var rdd  = new RequestDataDictionary();
            var pair = new KeyValuePair <string, string> ("foobar", "baz");

            nvc.Add("foobar", "baz");
            rdd.AddCollection(nvc);

            bool has_item = rdd.Contains(pair);

            Assert.IsTrue(has_item);
        }
コード例 #7
0
        public void Clear_ItemInCollection_RemovesItem()
        {
            var nvc = new DataDictionary ();
            var rdd = new RequestDataDictionary ();

            nvc.Add ("foobar", "baz");
            rdd.AddCollection (nvc);

            rdd.Clear ();

            bool has_item = rdd.ContainsKey ("foobar");

            Assert.IsFalse (has_item);
        }
コード例 #8
0
        public void Clear_ItemInCollection_RemovesItem()
        {
            var nvc = new DataDictionary();
            var rdd = new RequestDataDictionary();

            nvc.Add("foobar", "baz");
            rdd.AddCollection(nvc);

            rdd.Clear();

            bool has_item = rdd.ContainsKey("foobar");

            Assert.IsFalse(has_item);
        }
コード例 #9
0
        public void Contains_MultipleItemsWithPartialEndMatchesInCollection_ReturnsFalse()
        {
            var nvc  = new DataDictionary();
            var rdd  = new RequestDataDictionary();
            var pair = new KeyValuePair <string, string> ("foobar", "baz");

            nvc.Add("foobar", "abaz");
            nvc.Add("foobar", "abaz");
            nvc.Add("foobar", "abaz");
            rdd.AddCollection(nvc);

            bool has_item = rdd.Contains(pair);

            Assert.IsFalse(has_item);
        }
コード例 #10
0
        public void Count_SingleItemInCollection_ReturnsOne()
        {
            var nvc = new DataDictionary ();
            var rdd = new RequestDataDictionary ();

            nvc.Add ("foobar", "baz");
            rdd.AddCollection (nvc);

            Assert.AreEqual (1, rdd.Count);
        }
コード例 #11
0
        public void Count_ItemInCollectionAndItemAdded_ReturnsTwo()
        {
            var nvc = new DataDictionary ();
            var rdd = new RequestDataDictionary ();

            nvc.Add ("foobar", "baz");
            rdd.AddCollection (nvc);
            rdd.Add ("foobar", "baz");

            Assert.AreEqual (2, rdd.Count);
        }
コード例 #12
0
        public void Contains_MultipleItemsWithPartialStartMatchesInCollection_ReturnsFalse()
        {
            var nvc = new DataDictionary ();
            var rdd = new RequestDataDictionary ();
            var pair = new KeyValuePair<string,string> ("foobar", "baz");

            nvc.Add ("foobar", "baza");
            nvc.Add ("foobar", "baza");
            nvc.Add ("foobar", "baza");
            rdd.AddCollection (nvc);

            bool has_item = rdd.Contains (pair);
            Assert.IsFalse (has_item);
        }
コード例 #13
0
        public void Contains_MultipleItemsInCollectionMiddleKeyAndValuesMatch_ReturnsTrue()
        {
            var nvc = new DataDictionary ();
            var rdd = new RequestDataDictionary ();
            var pair = new KeyValuePair<string,string> ("foobar", "baz");

            nvc.Add ("foobar", "blah");
            nvc.Add ("foobar", "baz");
            nvc.Add ("foobar", "burrah");
            rdd.AddCollection (nvc);

            bool has_item = rdd.Contains (pair);
            Assert.IsTrue (has_item);
        }
コード例 #14
0
        public void ContainsKey_ItemInCollection_ReturnsTrue()
        {
            var nvc = new DataDictionary ();
            var rdd = new RequestDataDictionary ();

            nvc.Add ("foobar", "baz");
            rdd.AddCollection (nvc);

            bool has_item = rdd.ContainsKey ("foobar");
            Assert.IsTrue (has_item);
        }