当前位置: 首页>>代码示例>>C#>>正文


C# Generator.HasErrors方法代码示例

本文整理汇总了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());
 }
开发者ID:Mayur23491,项目名称:csharpblackberry,代码行数:9,代码来源:MainMethodCompTest.cs

示例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());
 }
开发者ID:Mayur23491,项目名称:csharpblackberry,代码行数:9,代码来源:KeywordsCompTest.cs

示例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());
 }
开发者ID:Mayur23491,项目名称:csharpblackberry,代码行数:9,代码来源:MethodDefinitionCompTest.cs

示例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());
 }
开发者ID:Mayur23491,项目名称:csharpblackberry,代码行数:9,代码来源:KeywordsCompTest.cs

示例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());
 }
开发者ID:Mayur23491,项目名称:csharpblackberry,代码行数:9,代码来源:ClassDefinitionCompTest.cs

示例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());
 }
开发者ID:Mayur23491,项目名称:csharpblackberry,代码行数:9,代码来源:ClassDefinitionCompTest.cs

示例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());
 }
开发者ID:Mayur23491,项目名称:csharpblackberry,代码行数:9,代码来源:ClassDefinitionCompTest.cs

示例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());
 }
开发者ID:Mayur23491,项目名称:csharpblackberry,代码行数:9,代码来源:ClassDefinitionCompTest.cs

示例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());
 }
开发者ID:Mayur23491,项目名称:csharpblackberry,代码行数:9,代码来源:UsingCompDirectiveTest.cs

示例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());
 }
开发者ID:Mayur23491,项目名称:csharpblackberry,代码行数:10,代码来源:NamespaceCompDirectiveTest.cs


注:本文中的Generator.HasErrors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。