コード例 #1
0
        public void GetExact()
        {
            var collection = new ClassContextCollection(_ccObjectWithMixin, _ccString, _ccListOfT, _ccListOfString);

            Assert.That(collection.GetExact(typeof(object)), Is.SameAs(_ccObjectWithMixin));
            Assert.That(collection.GetExact(typeof(string)), Is.SameAs(_ccString));
            Assert.That(collection.GetExact(typeof(int)), Is.Null);
            Assert.That(collection.GetExact(typeof(List <>)), Is.SameAs(_ccListOfT));
            Assert.That(collection.GetExact(typeof(List <int>)), Is.Null);
            Assert.That(collection.GetExact(typeof(List <string>)), Is.SameAs(_ccListOfString));
        }