コード例 #1
0
 public void Valid_code_is_compiled_to_a_class()
 {
     IBuildManager manager = new StandAloneBuildManager(new FakeViewProvider(@"@resource System.String
     @System.DateTime.Now"));
     var type = manager.GetCompiledType("ViewFile.cshtml");
     Assert.IsNotNull(type);
 }
コード例 #2
0
        public void Invalid_code_causes_exception_to_be_thrown()
        {
            IBuildManager manager = new StandAloneBuildManager(new FakeViewProvider(@"@resource System.String
@System.DateTime.Now2"));

            Assert.Throws <HttpCompileException>(() => manager.GetCompiledType("ViewFile.cshtml"));
        }
コード例 #3
0
        public void Valid_code_is_compiled_to_a_class()
        {
            IBuildManager manager = new StandAloneBuildManager(new FakeViewProvider(@"@resource System.String
@System.DateTime.Now"));
            var           type    = manager.GetCompiledType("ViewFile.cshtml");

            Assert.IsNotNull(type);
        }
コード例 #4
0
 public void Invalid_code_causes_exception_to_be_thrown()
 {
     IBuildManager manager = new StandAloneBuildManager(new FakeViewProvider(@"@resource System.String
     @System.DateTime.Now2"));
     Assert.Throws<HttpCompileException>(() => manager.GetCompiledType("ViewFile.cshtml"));
 }