Exemplo n.º 1
0
        public void TemplateKey_IsProjectKey()
        {
            var projectItem = new EmbeddedRazorProjectItem(typeof(Root), "ewffw");
            var document    = new Mock <RazorCSharpDocument>().Object;

            var template = new GeneratedRazorTemplate(projectItem, document);

            Assert.NotNull(template.TemplateKey);
            Assert.Equal(template.TemplateKey, projectItem.Key);
        }
Exemplo n.º 2
0
        public void Ensure_ConstructorParameters_AreApplied()
        {
            var projectItem = new EmbeddedRazorProjectItem(typeof(Root), "ewffw");
            var document    = new Mock <RazorCSharpDocument>().Object;

            var template = new GeneratedRazorTemplate(projectItem, document);

            Assert.Same(projectItem, template.ProjectItem);
            Assert.Same(document, template.CSharpDocument);
        }
Exemplo n.º 3
0
        public void GeneratedCode_Taken_From_CSharpDocument()
        {
            var projectItem = new EmbeddedRazorProjectItem(typeof(Root), "ewffw");

            string value = "test";
            var    moq   = new Mock <RazorCSharpDocument>();

            moq.Setup(t => t.GeneratedCode).Returns(value);

            var document = moq.Object;

            var template = new GeneratedRazorTemplate(projectItem, document);

            Assert.NotNull(template.GeneratedCode);
            Assert.Equal(template.GeneratedCode, document.GeneratedCode);
        }