コード例 #1
0
        public void ViewImports_Template_Test()
        {
            var template = new ViewImports(new SmartAppInfo {
                Id = ApplicationId
            });
            var output = template.TransformText();

            Assert.NotNull(output);
            Assert.NotEmpty(output);
            Assert.Contains($"@using {ApplicationId}.Backend", output);
            Assert.Contains($"@using {ApplicationId}.Backend.Models", output);
        }
コード例 #2
0
        public void ViewImports_Template_NullParameter_Test()
        {
            var template = new ViewImports(null);

            Assert.Throws <NullReferenceException>(() => template.TransformText());
        }
コード例 #3
0
        private void TransformViewsViewImports(SmartAppInfo manifest)
        {
            var template = new ViewImports(manifest);

            _writingService.WriteFile(Path.Combine(_context.BasePath, template.OutputPath), template.TransformText());
        }