コード例 #1
0
        public void GetWithInheritance_Cached()
        {
            Assert.That(_collectionWithObjectAndString.ContainsExact(typeof(ClassContextInheritanceTest)), Is.False);

            var inheritedContext1 = _collectionWithObjectAndString.GetWithInheritance(typeof(ClassContextCollectionTest));
            var inheritedContext2 = _collectionWithObjectAndString.GetWithInheritance(typeof(ClassContextCollectionTest));

            Assert.That(inheritedContext1, Is.SameAs(inheritedContext2));
        }
コード例 #2
0
        public void ContainsExact()
        {
            var collection = new ClassContextCollection(_ccObjectWithMixin, _ccString, _ccListOfT, _ccListOfString);

            Assert.That(collection.ContainsExact(typeof(object)), Is.True);
            Assert.That(collection.ContainsExact(typeof(string)), Is.True);
            Assert.That(collection.ContainsExact(typeof(int)), Is.False);
            Assert.That(collection.ContainsExact(typeof(List <>)), Is.True);
            Assert.That(collection.ContainsExact(typeof(List <int>)), Is.False);
            Assert.That(collection.ContainsExact(typeof(List <string>)), Is.True);
        }