public void Creation() { string File = ""; using (Utilities.DataTypes.CodeGen.Compiler Test = new Utilities.DataTypes.CodeGen.Compiler("Somewhere", typeof(CompilerBase).Assembly.Location.Left(typeof(CompilerBase).Assembly.Location.LastIndexOf('\\')), true)) { Assert.Equal(0, Test.Classes.Count); Assert.Equal(typeof(CompilerBase).Assembly.Location.Left(typeof(CompilerBase).Assembly.Location.LastIndexOf('\\')), Test.AssemblyDirectory); Assert.Equal("Somewhere", Test.AssemblyName); File = Test.AssemblyDirectory + "/" + Test.AssemblyName + ".dll"; } Assert.False(new Utilities.IO.FileInfo(File).Exists); new Utilities.IO.FileInfo(File).Delete(); }
public void CreateType() { string File = ""; using (Utilities.DataTypes.CodeGen.Compiler Test = new Utilities.DataTypes.CodeGen.Compiler("Test", ".", true)) { var Object = Test.CreateClass("A", "public class A{ public string Value1{get;set;}}", null, typeof(object).Assembly); Assert.Equal("Test.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", Object.Assembly.FullName); Assert.Equal("A", Object.FullName); File = Test.AssemblyDirectory + "/" + Test.AssemblyName + ".dll"; } Assert.True(new Utilities.IO.FileInfo(File).Exists); new Utilities.IO.FileInfo(File).Delete(); }
public void Creation() { string File = ""; using (Utilities.DataTypes.CodeGen.Compiler Test = new Utilities.DataTypes.CodeGen.Compiler("Somewhere", typeof(CompilerBase).Assembly.Location.Left(typeof(CompilerBase).Assembly.Location.LastIndexOf('\\')), true)) { Assert.Equal(0, Test.Classes.Count); Assert.Equal(typeof(CompilerBase).Assembly.Location.Left(typeof(CompilerBase).Assembly.Location.LastIndexOf('\\')), Test.AssemblyDirectory); Assert.Equal("Somewhere", Test.AssemblyName); File = Test.AssemblyDirectory + "/" + Test.AssemblyName + ".dll"; } Assert.False(new Utilities.IO.FileInfo(File).Exists); new Utilities.IO.FileInfo(File).Delete(); }
public void CreateType() { string File = ""; using (Utilities.DataTypes.CodeGen.Compiler Test = new Utilities.DataTypes.CodeGen.Compiler("Test", ".", true)) { var Object = Test.CreateClass("A", "public class A{ public string Value1{get;set;}}", null, typeof(object).Assembly); Assert.Equal("Test.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", Object.Assembly.FullName); Assert.Equal("A", Object.FullName); File = Test.AssemblyDirectory + "/" + Test.AssemblyName + ".dll"; } Assert.True(new Utilities.IO.FileInfo(File).Exists); new Utilities.IO.FileInfo(File).Delete(); }