本文整理汇总了C#中ICSharpCode.RubyBinding.NRefactoryToRubyConverter类的典型用法代码示例。如果您正苦于以下问题:C# NRefactoryToRubyConverter类的具体用法?C# NRefactoryToRubyConverter怎么用?C# NRefactoryToRubyConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NRefactoryToRubyConverter类属于ICSharpCode.RubyBinding命名空间,在下文中一共展示了NRefactoryToRubyConverter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ConvertedRubyCode
public void ConvertedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(csharp);
string expectedRuby =
"class Class1\r\n" +
" def initialize()\r\n" +
" @name = String.Empty\r\n" +
" @lastName = String.Empty\r\n" +
" end\r\n" +
"\r\n" +
" def Name\r\n" +
" return @name\r\n" +
" end\r\n" +
"\r\n" +
" def Name=(value)\r\n" +
" @name = value\r\n" +
" end\r\n" +
"\r\n" +
" def LastName\r\n" +
" return @lastName\r\n" +
" end\r\n" +
"\r\n" +
" def LastName=(value)\r\n" +
" @lastName = value\r\n" +
" end\r\n" +
"\r\n" +
" def Clone()\r\n" +
" return Class1.new(Name = \"First\", LastName = \"Last\")\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby, Ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:35,代码来源:ObjectInitializerConversionTestFixture.cs
示例2: ConvertedRubyCode
public void ConvertedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(csharp);
string expectedRuby =
"# <summary>\r\n" +
"# Class Foo\r\n" +
"# </summary>\r\n" +
"class Foo\r\n" +
" # <summary>\r\n" +
" # Run\r\n" +
" # </summary>\r\n" +
" def Run()\r\n" +
" end\r\n" +
"\r\n" +
" # <summary> Stop </summary>\r\n" +
" def Stop()\r\n" +
" end\r\n" +
"\r\n" +
" # <summary> Initialize.</summary>\r\n" +
" def initialize()\r\n" +
" # Initialize j.\r\n" +
" j = 0 # Set to zero\r\n" +
" # test\r\n" +
" if j == 0 then\r\n" +
" j = 2\r\n" +
" end\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby, Ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:33,代码来源:XmlDocCommentConversionTestFixture.cs
示例3: ConvertedRubyCode
public void ConvertedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(csharp);
string expectedRuby =
"class Foo\r\n" +
" def initialize()\r\n" +
" @count = 0\r\n" +
" @i = 0\r\n" +
" end\r\n" +
"\r\n" +
" def Count\r\n" +
" if @i == 0 then\r\n" +
" return 10\r\n" +
" else\r\n" +
" return @count\r\n" +
" end\r\n" +
" end\r\n" +
"\r\n" +
" def Count=(value)\r\n" +
" if @i == 1 then\r\n" +
" @count = value\r\n" +
" else\r\n" +
" @count = value + 5\r\n" +
" end\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:31,代码来源:PropertyWithGetSetStatementsTestFixture.cs
示例4: ConvertedRubyCode
public void ConvertedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(csharp);
string expectedRuby =
"class Foo\r\n" +
" def initialize()\r\n" +
" @count = 0\r\n" +
" end\r\n" +
"\r\n" +
" def Count\r\n" +
" return @count\r\n" +
" end\r\n" +
"\r\n" +
" def Increment()\r\n" +
" self.Count += 1\r\n" +
" end\r\n" +
"\r\n" +
" def SetCount(Count)\r\n" +
" self.Count = Count\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby, Ruby);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:26,代码来源:PropertyReferenceConversionTestFixture.cs
示例5: GeneratedMainMethodCallWithNoParametersCode
public void GeneratedMainMethodCallWithNoParametersCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
converter.Convert(mainMethodWithNoParametersCode);
string code = converter.GenerateMainMethodCall(converter.EntryPointMethods[0]);
Assert.AreEqual("Foo.Main()", code);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:8,代码来源:GenerateMainMethodCallTestFixture.cs
示例6: MultiplyOperator
public void MultiplyOperator()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(GetCode(csharp, "*="));
string expectedRuby = GetCode(RubyCodeTemplate, "*=");
Assert.AreEqual(expectedRuby, Ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:9,代码来源:AssignmentOperatorConversionTestFixture.cs
示例7: ConvertedRubyCode
public void ConvertedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
string Ruby = converter.Convert(csharp);
string expectedRuby = "class Foo\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:9,代码来源:EmptyCSharpClassConversionTestFixture.cs
示例8: ConvertedRubyCode
public void ConvertedRubyCode()
{
string expectedCode =
"class Foo < Bar, IMyInterface\r\n" +
"end";
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string code = converter.Convert(csharp);
Assert.AreEqual(expectedCode, code);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:11,代码来源:BaseClassConversionTestFixture.cs
示例9: GeneratedRubyCode
public void GeneratedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
string Ruby = converter.Convert(csharp);
string expectedRuby = "require \"mscorlib\"\r\n" +
"require \"System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\"\r\n" +
"\r\n" +
"class Foo\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:12,代码来源:UsingStatementConversionTestFixture.cs
示例10: Convert
public static bool Convert(SupportedLanguage inputLanguage, string ProvidedSource, out string ConvertedSource, out string ErrorMessage)
{
NRefactoryToRubyConverter converter = new
NRefactoryToRubyConverter(inputLanguage);
string convertedCode = converter.Convert(ProvidedSource);
ConvertedSource = convertedCode;
ErrorMessage = "";
return true;
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:12,代码来源:RubyHelpers.cs
示例11: GeneratedRubyCode
public void GeneratedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(csharp);
string expectedRuby = "class Foo\r\n" +
" def Init()\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:12,代码来源:SingleClassMethodConversionTestFixture.cs
示例12: ConvertedRubyCode
public void ConvertedRubyCode()
{
string expectedCode = "class Foo\r\n" +
" def Run()\r\n" +
" raise XmlException.new()\r\n" +
" end\r\n" +
"end";
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string code = converter.Convert(csharp);
Assert.AreEqual(expectedCode, code);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:13,代码来源:ThrowExceptionConversionTestFixture.cs
示例13: GeneratedRubySourceCode
public void GeneratedRubySourceCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.VBNet);
converter.IndentString = " ";
string Ruby = converter.Convert(vb);
string expectedRuby =
"module DefaultNamespace\r\n" +
" class Class1\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:13,代码来源:VBClassConversionTestFixture.cs
示例14: ConvertedRubyCode
public void ConvertedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(csharp);
string expectedRuby =
"class Foo\r\n" +
" def IsEqual(o)\r\n" +
" return System::Object.ReferenceEquals(o, nil)\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby, Ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:14,代码来源:ObjectReferenceEqualsConversionTestFixture.cs
示例15: ConvertedRubyCode
public void ConvertedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(csharp);
string expectedRuby = "class Foo\r\n" +
" def TestMe(test)\r\n" +
" a = test ? \"Ape\" : \"Monkey\"\r\n" +
" return a\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:14,代码来源:TernaryOperatorConversionTestFixture.cs
示例16: ConvertCSharpClassWithFieldsWhereFirstFieldDoesNotHaveInitialValue
public void ConvertCSharpClassWithFieldsWhereFirstFieldDoesNotHaveInitialValue()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string ruby = converter.Convert(csharpClassWithTwoFieldsWhereFirstDoesNotHaveInitialValue);
string expectedRuby =
"class Foo\r\n" +
" def initialize()\r\n" +
" @j = 1\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:14,代码来源:MultipleFieldsOnSameLineTests.cs
示例17: ConvertedRubyCode
public void ConvertedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(csharp);
string expectedRuby =
"class Foo\r\n" +
" def initialize()\r\n" +
" System.Console.WriteLine(\"Test\")\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:14,代码来源:StaticClassReferenceTestFixture.cs
示例18: ConvertedRubyCode
public void ConvertedRubyCode()
{
string expectedRuby =
"class Foo\r\n" +
" def initialize()\r\n" +
" b = Bar.new(0, 0, 1, 10)\r\n" +
" end\r\n" +
"end";
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(csharp);
Assert.AreEqual(expectedRuby, Ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:15,代码来源:CallConstructorWithParametersConversionTestFixture.cs
示例19: ConvertVBNetClassWithTwoArrayVariablesOnSameLine
public void ConvertVBNetClassWithTwoArrayVariablesOnSameLine()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.VBNet);
converter.IndentString = " ";
string ruby = converter.Convert(vnetClassWithTwoArrayLocalVariablesOnSameLine);
string expectedRuby =
"class Foo\r\n" +
" def initialize()\r\n" +
" i = Array.CreateInstance(System::Int32, 10)\r\n" +
" j = Array.CreateInstance(System::Int32, 20)\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:15,代码来源:LocalVariableDefinitionsOnSameLineTests.cs
示例20: ConvertedRubyCode
public void ConvertedRubyCode()
{
NRefactoryToRubyConverter converter = new NRefactoryToRubyConverter(SupportedLanguage.CSharp);
converter.IndentString = " ";
string Ruby = converter.Convert(csharp);
string expectedRuby =
"class Foo\r\n" +
" def Convert()\r\n" +
" a = (b >> 16) & 0xffff\r\n" +
" return a\r\n" +
" end\r\n" +
"end";
Assert.AreEqual(expectedRuby, Ruby);
}
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:15,代码来源:BitShiftConversionTestFixture.cs
注:本文中的ICSharpCode.RubyBinding.NRefactoryToRubyConverter类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论