public void T4CodeGenTest_VBCodeGenError()
        {
            string testName = "T4CG_VBCodeGenError_CS";

            Type[] domainServiceTypes = new Type[] {
                typeof(TestDomainService1)
            };

            string[] refAssemblies = new string[] {
                Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName,
            };

            using (T4AssemblyGenerator asmGen = new T4AssemblyGenerator(testName, /* isCSharp */ false, /* useFullTypeNames */ false, domainServiceTypes))
            {
                foreach (string refAssembly in refAssemblies)
                {
                    asmGen.ReferenceAssemblies.Add(refAssembly);
                }

                string generatedCode = asmGen.GeneratedCode;
                Assert.IsTrue(string.IsNullOrEmpty(generatedCode));
                Assert.IsTrue(asmGen.ConsoleLogger.HasLoggedErrors);
                Assert.AreEqual(string.Format(CultureInfo.CurrentCulture, TextTemplateResource.NonCSharpLanguageNotSupported),
                                asmGen.ConsoleLogger.ErrorMessages.First());
            }
        }
        public void T4CodeGenTest_VBCodeGenError()
        {
            string testName = "T4CG_VBCodeGenError_CS";
            Type[] domainServiceTypes = new Type[] {
                typeof(TestDomainService1)
            };

            string[] refAssemblies = new string[] {
                Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName,
           };

            using (T4AssemblyGenerator asmGen = new T4AssemblyGenerator(testName, /* isCSharp */ false, /* useFullTypeNames */ false, domainServiceTypes))
            {
                
                foreach (string refAssembly in refAssemblies)
                {
                    asmGen.ReferenceAssemblies.Add(refAssembly);
                }

                string generatedCode = asmGen.GeneratedCode;
                Assert.IsTrue(string.IsNullOrEmpty(generatedCode));
                Assert.IsTrue(asmGen.ConsoleLogger.HasLoggedErrors);
                Assert.AreEqual(string.Format(CultureInfo.CurrentCulture, TextTemplateResource.NonCSharpLanguageNotSupported),
                    asmGen.ConsoleLogger.ErrorMessages.First());
            }
        }
        internal static void GenerateAndVerifyCodeGenerators(string testName, Type[] domainServiceTypes, Type[] sharedTypes, string[] refAssemblies)
        {
            Assembly codeDomCodeGenAssembly = null;
            Assembly t4CodeGenAssembly = null;
            using (AssemblyGenerator asmGen = new AssemblyGenerator(testName, /* isCSharp */ true, /* useFullTypeNames */ false, domainServiceTypes))
            {
                foreach (Type t in sharedTypes)
                {
                    asmGen.MockSharedCodeService.AddSharedType(t);
                }

                foreach (string refAssembly in refAssemblies)
                {
                    asmGen.ReferenceAssemblies.Add(refAssembly);
                }

                string generatedCode = asmGen.GeneratedCode;
                Assert.IsFalse(string.IsNullOrEmpty(generatedCode), "Failed to generate code:\r\n" + asmGen.ConsoleLogger.Errors);

                codeDomCodeGenAssembly = asmGen.GeneratedAssembly;
                Assert.IsNotNull(codeDomCodeGenAssembly, "Assembly failed to build: " + asmGen.ConsoleLogger.Errors);

            }

            using (T4AssemblyGenerator asmGen = new T4AssemblyGenerator(testName, /* isCSharp */ true, /* useFullTypeNames */ false, domainServiceTypes))
            {
                foreach (Type t in sharedTypes)
                {
                    asmGen.MockSharedCodeService.AddSharedType(t);
                }

                foreach (string refAssembly in refAssemblies)
                {
                    asmGen.ReferenceAssemblies.Add(refAssembly);
                }

                string generatedCode = asmGen.GeneratedCode;
                Assert.IsFalse(string.IsNullOrEmpty(generatedCode), "Failed to generate code:\r\n" + asmGen.ConsoleLogger.Errors);

                t4CodeGenAssembly = asmGen.GeneratedAssembly;
                Assert.IsNotNull(t4CodeGenAssembly, "Assembly failed to build: " + asmGen.ConsoleLogger.Errors);
            }

            TestHelper.VerifyAssembliesEquality(codeDomCodeGenAssembly, t4CodeGenAssembly);
        }