Exemple #1
0
        [Test] public void Test()
        {
            var instance = new VBCompiler().Run();

            Assert.IsNotNull(instance);
            Assert.AreEqual("Namespace0.Class0", instance.GetType().FullName);
        }
Exemple #2
0
        public void CannotCompile()
        {
            CompilerSettings s = new CompilerSettings();
              VBCompiler c = new VBCompiler(s);

              ICompilerResults cr = c.CompileFiles(new string[] { @"..\..\etc\testdata\compiler\compile_fail.cs" });
              Assert.False(cr.Success);
              string formatted_erros = cr.GetFormattedErrors();
              Assert.True(formatted_erros.Contains("compile_fail.cs(5,0)"));
        }
Exemple #3
0
        public void Compile_Hello_World_Program()
        {
            var compiler = new VBCompiler();

            byte[] il       = compiler.Compile.FromFile("Input/HelloWorld.vb", assemblyName: "HelloWorld");
            var    assembly = Assembly.Load(il);

            string output = RunAndCaptureOutput(assembly, args: new string[] { "VB.NET" });

            Assert.AreEqual("Hello VB.NET!" + Environment.NewLine, output);
        }