本文整理汇总了C#中Generator.HasErrors方法的典型用法代码示例。如果您正苦于以下问题:C# Generator.HasErrors方法的具体用法?C# Generator.HasErrors怎么用?C# Generator.HasErrors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generator
的用法示例。
在下文中一共展示了Generator.HasErrors方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compile
public void Compile()
{
List<String> code = new List<String>();
code.Add("static void Main(string[] args) {");
Generator gen = new Generator(code, true);
gen.Run();
Assert.IsFalse(gen.HasErrors(), "Not suppose to have errors");
Assert.AreEqual("public static void main(String[] args) { ", gen.GetAllCode());
}
示例2: RemoveKeyword
public void RemoveKeyword()
{
List<String> code = new List<String>();
code.Add("operator t");
Generator gen = new Generator(code, true);
gen.Run();
Assert.IsFalse(gen.HasErrors(), "Not suppose to have errors");
Assert.AreEqual(" t", gen.GetAllCode());
}
示例3: IdentifyTwo
public void IdentifyTwo()
{
List<String> code = new List<String>();
code.Add("void setSurname() {");
Generator gen = new Generator(code, true);
gen.Run();
Assert.IsFalse(gen.HasErrors(), "Not suppose to have errors");
Assert.AreEqual("void setSurname() {", gen.GetAllCode());
}
示例4: ConvertBase
public void ConvertBase()
{
List<String> code = new List<String>();
code.Add("base.setTitle(\"Hello World\");");
Generator gen = new Generator(code, true);
gen.Run();
Assert.IsFalse(gen.HasErrors(), "Not suppose to have errors");
Assert.AreEqual("super.setTitle(\"Hello World\");", gen.GetAllCode());
}
示例5: NormalClass
public void NormalClass()
{
List<String> code = new List<String>();
code.Add("public class HelloDude {");
Generator gen = new Generator(code, true);
gen.Run();
Assert.IsFalse(gen.HasErrors(), "Not suppose to have errors");
Assert.AreEqual("public class HelloDude {", gen.GetAllCode());
}
示例6: ImplementOnlyAnInterface
public void ImplementOnlyAnInterface()
{
List<String> code = new List<String>();
code.Add("class HelloDude: IComparable {");
Generator gen = new Generator(code, true);
gen.Run();
Assert.IsFalse(gen.HasErrors(), "Not suppose to have errors");
Assert.AreEqual("public class HelloDude implements IComparable {", gen.GetAllCode());
}
示例7: ClassWithOneSuperClass
public void ClassWithOneSuperClass()
{
List<String> code = new List<String>();
code.Add("public class HelloDude: MyWorld {");
Generator gen = new Generator(code, true);
gen.Run();
Assert.IsFalse(gen.HasErrors(), "Not suppose to have errors");
Assert.AreEqual("public class HelloDude extends MyWorld {", gen.GetAllCode());
}
示例8: AddDefaultModifier
public void AddDefaultModifier()
{
List<String> code = new List<String>();
code.Add("class HelloDude: ThisIsMyPlanet {");
Generator gen = new Generator(code, true);
gen.Run();
Assert.IsFalse(gen.HasErrors(), "Not suppose to have errors");
Assert.AreEqual("public class HelloDude extends ThisIsMyPlanet {", gen.GetAllCode());
}
示例9: NotSupportedYet
public void NotSupportedYet()
{
List<String> code = new List<String>();
code.Add("using System.Linq;");
Generator gen = new Generator(code, true);
gen.Run();
Assert.IsTrue(gen.HasErrors(), "got errors");
Assert.AreEqual("//using System.Linq; // Not supported yet", gen.GetAllCode());
}
示例10: Compile
public void Compile()
{
List<String> code = new List<String>();
code.Add("namespace com.lennie.test {");
Generator gen = new Generator(code, true);
gen.Run();
Assert.IsFalse(gen.HasErrors(), "Not suppose to have errors");
Assert.IsNullOrEmpty(gen.GetAllCode());
//Assert.AreEqual("package com.lennie.test;", gen.GetAllCode());
}