コード例 #1
0
        public void ResolveWithNullSubbranch()
        {
            // Setup
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "TestViews");

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

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

            // Assert
            var view = catalog.Resolve(a_catalogName:null);
        }
コード例 #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);
        }
コード例 #5
0
ファイル: MvcEngineTest.cs プロジェクト: jsmunroe/SimpleMvc
        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);
        }
コード例 #6
0
ファイル: MvcEngineTest.cs プロジェクト: jsmunroe/SimpleMvc
        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);
        }
コード例 #7
0
        public void ToTypeNameWithNull()
        {
            // Setup
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "TestViews", "View");

            // Execute
            var typeName = catalog.ToTypeName(a_catalogName: null);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #10
0
        public void ResolveWithSubbranchWithNullName()
        {
            // Setup
            var catalog = new DirectoryCatalog(Assembly.GetExecutingAssembly(), "TestViews");

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