Пример #1
0
 public void DomainTypeResolver_Test()
 {
     DomainTypeResolver resolver = new DomainTypeResolver(true);
     Assert.AreEqual(typeof(object), resolver.ResolveType("object"));
     Assert.AreEqual(typeof(Int32), resolver.ResolveType("int"));
     Assert.AreEqual(typeof(object[]), resolver.ResolveType("object[]"));
 }
Пример #2
0
        public void DomainTypeResolver_Test()
        {
            DomainTypeResolver resolver = new DomainTypeResolver(true);

            Assert.AreEqual(typeof(object), resolver.ResolveType("object"));
            Assert.AreEqual(typeof(Int32), resolver.ResolveType("int"));
            Assert.AreEqual(typeof(object[]), resolver.ResolveType("object[]"));
        }
Пример #3
0
        public void AddTypeAlias_Test()
        {
            DomainTypeResolver resolver = new DomainTypeResolver(false);
            DomainTypeResolver ignoreCaseResolver = new DomainTypeResolver(true);

            resolver.AddAssemblyAlias("test", "Moonlit.TestFixtures, Version=1.0.0.0, Culture=neutral");
            resolver.AddTypeAlias("int", typeof(Int32));
            Assert.AreEqual(typeof(Int32), ignoreCaseResolver.ResolveType("int"));
            Assert.AreEqual(typeof(Int32), ignoreCaseResolver.ResolveType("Int"));
            Assert.IsNull(resolver.ResolveType("Int"));
        }
Пример #4
0
        public void AddTypeAlias_Test()
        {
            DomainTypeResolver resolver           = new DomainTypeResolver(false);
            DomainTypeResolver ignoreCaseResolver = new DomainTypeResolver(true);

            resolver.AddAssemblyAlias("test", "Moonlit.TestFixtures, Version=1.0.0.0, Culture=neutral");
            resolver.AddTypeAlias("int", typeof(Int32));
            Assert.AreEqual(typeof(Int32), ignoreCaseResolver.ResolveType("int"));
            Assert.AreEqual(typeof(Int32), ignoreCaseResolver.ResolveType("Int"));
            Assert.IsNull(resolver.ResolveType("Int"));
        }
Пример #5
0
        public void ResolveType_Test()
        {
            DomainTypeResolver resolver = new DomainTypeResolver(false);
            DomainTypeResolver ignoreCaseResolver = new DomainTypeResolver(true);
            Assert.IsNull(resolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures, version=1.0.0.0, culture=neutral"));
            Assert.IsNull(resolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures, version=1.0.0.0"));
            Assert.IsNull(resolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures"));

            Assert.AreEqual(typeof(DemoClass), ignoreCaseResolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures, version=1.0.0.0, culture=neutral"));
            Assert.AreEqual(typeof(DemoClass), ignoreCaseResolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures, version=1.0.0.0"));
            Assert.AreEqual(typeof(DemoClass), ignoreCaseResolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures"));
            Assert.AreEqual(typeof(DemoClass), resolver.ResolveType("Moonlit.TestFixtures.DemoClass, Moonlit.TestFixtures, Version=1.0.0.0, Culture=neutral"));
            Assert.AreEqual(typeof(DemoClass), resolver.ResolveType("Moonlit.TestFixtures.DemoClass, Moonlit.TestFixtures, Version=1.0.0.0"));
            Assert.AreEqual(typeof(DemoClass), resolver.ResolveType("Moonlit.TestFixtures.DemoClass, Moonlit.TestFixtures"));
        }
Пример #6
0
        public void AddAssemblyAlias_Test()
        {
            DomainTypeResolver resolver = new DomainTypeResolver(true);

            resolver.AddAssemblyAlias("test", "Moonlit.TestFixtures, Version=1.0.0.0, Culture=neutral");
            Assert.AreEqual(typeof(DemoClass), resolver.ResolveType("Moonlit.TestFixtures.DemoClass, test"));
        }
Пример #7
0
        public void AddAssemblyAlias_Test()
        {
            DomainTypeResolver resolver = new DomainTypeResolver(true);

            resolver.AddAssemblyAlias("test", "Moonlit.TestFixtures, Version=1.0.0.0, Culture=neutral");
            Assert.AreEqual(typeof(DemoClass), resolver.ResolveType("Moonlit.TestFixtures.DemoClass, test"));
        }
Пример #8
0
        public void ResolveType_Test()
        {
            DomainTypeResolver resolver           = new DomainTypeResolver(false);
            DomainTypeResolver ignoreCaseResolver = new DomainTypeResolver(true);

            Assert.IsNull(resolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures, version=1.0.0.0, culture=neutral"));
            Assert.IsNull(resolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures, version=1.0.0.0"));
            Assert.IsNull(resolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures"));

            Assert.AreEqual(typeof(DemoClass), ignoreCaseResolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures, version=1.0.0.0, culture=neutral"));
            Assert.AreEqual(typeof(DemoClass), ignoreCaseResolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures, version=1.0.0.0"));
            Assert.AreEqual(typeof(DemoClass), ignoreCaseResolver.ResolveType("moonlit.testfixtures.democlass, moonlit.testfixtures"));
            Assert.AreEqual(typeof(DemoClass), resolver.ResolveType("Moonlit.TestFixtures.DemoClass, Moonlit.TestFixtures, Version=1.0.0.0, Culture=neutral"));
            Assert.AreEqual(typeof(DemoClass), resolver.ResolveType("Moonlit.TestFixtures.DemoClass, Moonlit.TestFixtures, Version=1.0.0.0"));
            Assert.AreEqual(typeof(DemoClass), resolver.ResolveType("Moonlit.TestFixtures.DemoClass, Moonlit.TestFixtures"));
        }