Beispiel #1
0
        public void TrueFalse()
        {
            var strRepo = new StringKeyRepo();
            var numRepo = new NumberKeyRepo();

            strRepo.Add(new TestClass("a"));
            numRepo.Add(new TestClass(1));

            Assert.True(strRepo.Has(new TestClass("a")));
            Assert.True(numRepo.Has(new TestClass(1)));

            Assert.False(strRepo.Has(new TestClass("b")));
            Assert.False(numRepo.Has(new TestClass(2)));
        }
Beispiel #2
0
        public void Nulls()
        {
            var strRepo = new StringKeyRepo();
            var numRepo = new NumberKeyRepo();

            Assert.False(strRepo.Has(null));
            Assert.False(numRepo.Has(null));

            strRepo.Add(new TestClass("a"));
            numRepo.Add(new TestClass(1));

            Assert.False(strRepo.Has(null));
            Assert.False(numRepo.Has(null));
        }