Esempio n. 1
0
        public void ResolveWithNullSubbranch()
        {
            // Setup
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "TestViews");

            // Execute
            var view = catalog.Resolve(a_sub: null, a_typeName: "TestView1");
        }
Esempio n. 2
0
        public void ConstructDirectoryViewCatalog()
        {
            // Execute
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "Views");

            // Assert
            Assert.AreEqual("SimpleMvc.Test.Views", catalog.Namespace);
        }
Esempio n. 3
0
        public void ResolveWithNullName()
        {
            // Setup
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "TestViews");

            // Assert
            var view = catalog.Resolve(a_catalogName:null);
        }
Esempio n. 4
0
        public void Resolve()
        {
            // Setup
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "TestViews");

            // Execute
            var view = catalog.Resolve("TestView1");

            // Assert
            Assert.IsTrue(view is TestView1);
        }
Esempio n. 5
0
        public void RegisterViewCatalog()
        {
            // Setup
            var mvc = new MvcEngine();
            var viewCatalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "Views", "", typeof (object));

            // Execute
            var result = mvc.RegisterViewCatalog(viewCatalog);

            // Assert
            Assert.AreSame(mvc, result);
        }
Esempio n. 6
0
        public void RegisterControllerCatalog()
        {
            // Setup
            var mvc = new MvcEngine();
            var catalogController = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "Controllers");

            // Execute
            var result = mvc.RegisterControllerCatalog(catalogController);

            // Assert
            Assert.AreSame(mvc, result);
        }
Esempio n. 7
0
        public void ToTypeNameWithNull()
        {
            // Setup
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "TestViews", "View");

            // Execute
            var typeName = catalog.ToTypeName(a_catalogName: null);
        }
Esempio n. 8
0
        public void ToTypeName()
        {
            // Setup
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "TestViews", "View");

            // Execute
            var typeName = catalog.ToTypeName("Test");

            // Assert
            Assert.AreEqual("TestView", typeName);
        }
Esempio n. 9
0
        public void ToCatalogNameWithIncorrectSuffix()
        {
            // Setup
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "TestViews", "View");

            // Execute
            var catalogName = catalog.ToCatalogName("TestXiew");

            // Assert
            Assert.AreEqual("TestXiew", catalogName);
        }
Esempio n. 10
0
        public void ResolveWithSubbranchWithNullName()
        {
            // Setup
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "TestViews");

            // Execute
            var view = catalog.Resolve(a_sub: "TestController", a_typeName: null);
        }