Ejemplo n.º 1
0
		public void IsTemplateForJSGeneration_ShouldReturnTrueForExistingTemplateWithoutExtension()
		{
			TestableViewEngineBase engine = new TestableViewEngineBase();
			engine.Service(new TestServiceProvider(new TestViewSourceLoader("fakeview.testjs")));
			Assert.IsTrue(engine.IsTemplateForJSGeneration("fakeview"),
			              "Should have been accepted and found without extension");
		}
Ejemplo n.º 2
0
		public void IsTemplateForJSGeneration_ShouldReturnFalseForNonExistentTemplateWithNoExtension()
		{
			TestableViewEngineBase engine = new TestableViewEngineBase();
			engine.Service(new TestServiceProvider(new TestViewSourceLoader()));
			Assert.IsFalse(engine.IsTemplateForJSGeneration("view.testjs"),
			               "This template does not 'exist' so it should have failed");
		}
Ejemplo n.º 3
0
		public void IsTemplateForJSGeneration_ShouldReturnTrueForExistingTemplateWithCorrectExtension()
		{
			const string templateName = "fakeview.testjs";
			TestableViewEngineBase engine = new TestableViewEngineBase();
			engine.Service(new TestServiceProvider(new TestViewSourceLoader(templateName)));
			Assert.IsTrue(engine.IsTemplateForJSGeneration(templateName),
			              "Should have been accepted and found with correct extension");
		}
Ejemplo n.º 4
0
		public void IsTemplateForJSGeneration_ShouldReturnFalseForTemplateWithAnotherExtension()
		{
			const string templateName = "view.test";
			TestableViewEngineBase engine = new TestableViewEngineBase();
			engine.Service(new TestServiceProvider(new TestViewSourceLoader(templateName)));
			Assert.IsFalse(engine.IsTemplateForJSGeneration(templateName),
			               "This is a template typed by extension as not for JSGen and should not have been accepted");
		}
        public void IsTemplateForJSGeneration_ShouldReturnTrueForExistingTemplateWithoutExtension()
        {
            var engine = new TestableViewEngineBase();

            engine.Service(new TestServiceProvider(new TestViewSourceLoader("fakeview.testjs")));
            Assert.IsTrue(engine.IsTemplateForJSGeneration("fakeview"),
                          "Should have been accepted and found without extension");
        }
        public void IsTemplateForJSGeneration_ShouldReturnFalseForNonExistentTemplateWithNoExtension()
        {
            var engine = new TestableViewEngineBase();

            engine.Service(new TestServiceProvider(new TestViewSourceLoader()));
            Assert.IsFalse(engine.IsTemplateForJSGeneration("view.testjs"),
                           "This template does not 'exist' so it should have failed");
        }
        public void IsTemplateForJSGeneration_ShouldReturnTrueForExistingTemplateWithCorrectExtension()
        {
            const string templateName = "fakeview.testjs";
            var          engine       = new TestableViewEngineBase();

            engine.Service(new TestServiceProvider(new TestViewSourceLoader(templateName)));
            Assert.IsTrue(engine.IsTemplateForJSGeneration(templateName),
                          "Should have been accepted and found with correct extension");
        }
        public void IsTemplateForJSGeneration_ShouldReturnFalseForTemplateWithAnotherExtension()
        {
            const string templateName = "view.test";
            var          engine       = new TestableViewEngineBase();

            engine.Service(new TestServiceProvider(new TestViewSourceLoader(templateName)));
            Assert.IsFalse(engine.IsTemplateForJSGeneration(templateName),
                           "This is a template typed by extension as not for JSGen and should not have been accepted");
        }