示例#1
0
        public void CodeGen_Attribute_KeyAttribute_Missing_Pass()
        {
            var    logger        = new ConsoleLogger();
            string generatedCode = TestHelper.GenerateCode("C#", typeof(Mock_CG_Attr_Entity_Missing_Key), logger);

            Assert.IsTrue(!string.IsNullOrEmpty(generatedCode));
            TestHelper.AssertCodeGenSuccess(generatedCode, logger);
        }
示例#2
0
        internal static string GenerateCodeAssertSuccess(string language, IEnumerable <Type> entityTypes, ConsoleLogger logger, ISharedCodeService typeService, bool useFullNames)
        {
            ClientCodeGenerationOptions options = CreateMockCodeGenContext(language, useFullNames);
            ICodeGenerationHost         host    = CreateMockCodeGenerationHost(logger, typeService);
            string generatedCode = GenerateCode(host, options, entityTypes);

            TestHelper.AssertCodeGenSuccess(generatedCode, ((MockCodeGenerationHost)host).LoggingService as ConsoleLogger);
            return(generatedCode);
        }
示例#3
0
        internal static string GenerateCodeAssertSuccess(string language, Type entityType)
        {
            ConsoleLogger logger = new ConsoleLogger();
            ClientCodeGenerationOptions options = CreateMockCodeGenContext(language, false);
            ICodeGenerationHost         host    = CreateMockCodeGenerationHost(logger, null);
            string generatedCode = GenerateCode(host, options, new Type[] { entityType });

            TestHelper.AssertCodeGenSuccess(generatedCode, logger);
            return(generatedCode);
        }