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[]"));
 }
        public void DumplicateAdd_Test()
        {
            DomainTypeResolver resolver = new DomainTypeResolver(true);

            resolver.AddTypeAlias("int", typeof(Int64));
            resolver.AddTypeAlias("int", typeof(Int32));
        }
        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"));
        }
Exemple #4
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"));
        }
Exemple #5
0
        public void DumplicateAdd_Test()
        {
            DomainTypeResolver resolver = new DomainTypeResolver(true);

            resolver.AddTypeAlias("int", typeof(Int64));
            resolver.AddTypeAlias("int", typeof(Int32));
        }
Exemple #6
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[]"));
        }
        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"));
        }
Exemple #8
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"));
        }
        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"));
        }
Exemple #10
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"));
        }