예제 #1
0
        public void GetType_TypeInAssembly_ReturnsType()
        {
            var subject = new AssemblyTypeContainer(GetType().Assembly);
            var result = subject.GetType(typeof(AssemblyTypeContainerTests).FullName);

            Assert.AreEqual(typeof(AssemblyTypeContainerTests), result);
        }
예제 #2
0
        public void GetType_SlashInsteadOfPlusInNestedTypeName_ReturnsNestedType()
        {
            var subject = new AssemblyTypeContainer(GetType().Assembly);
            var result = subject.GetType(typeof(NestedType).FullName.Replace("+", "/"));

            Assert.AreEqual(typeof(NestedType), result);
        }
예제 #3
0
        public void GetType_TypeNotInAssembly_ThrowsTypeLoadException()
        {
            var subject = new AssemblyTypeContainer(typeof(object).Assembly);

            Assert.Throws<TypeLoadException>(() =>
            {
                subject.GetType(typeof(AssemblyTypeContainerTests).FullName);
            });
        }