public void KeyIsNotPresentUsingContainsKeyUsingKeyedCollectionDefaultComparer()
        {
            var list = new TestKeyedCollection {
                "ALICE", "BOB", "CALUM"
            };

            Assert.That(list, !Does.ContainKey("alice"));
        }
        public void SucceedsWhenKeyIsPresentUsingContainsKeyWhenUsingKeyedCollectionCustomComparer()
        {
            var list = new TestKeyedCollection(StringComparer.OrdinalIgnoreCase)
            {
                "ALICE", "BOB", "CALUM"
            };

            Assert.That(list, Does.ContainKey("calum"));
        }
Ejemplo n.º 3
0
        public void ShouldSerialize()
        {
            var collection = new TestKeyedCollection()
            {
                11, 12, 13
            };
            var value = JsonConvert.SerializeObject(collection, jsonSettings);

            Assert.That(value, Is.EqualTo("{\"11\":11,\"12\":12,\"13\":13}"));
        }