IronPython看来是一个做UnitTest的不错工具,但目前不支持中文J

Filename: HelloWord.cs

using System;

namespace MyTest

{

public class test

{

       public string HelloWord(string Hello)

       {

              return Hello + " This is Test" ;

       }

      

       public string hello2()

       {

              return "This is Test";

       }

}

}

Csc /t:library HelloWord.cs

 

C:\SharpTools\IronPython-0.6\bin>IronPythonConsole.exe

>>> import sys

>>> sys.LoadAssemblyFromFile("Helloword.dll")

>>> from MyTest import *

>>> t = test()

>>> t.hello2

<method# hello2 on MyTest.test>

>>> t.hello2()

'This is Test'

>>> t.HelloWord("OK! ---")

'OK! --- This is Test'

>>> t.HelloWord("中文")

u'\x4e2d\x6587 This is Test'

>>>

 

 

有意思J

相关文章:

  • 2021-11-05
  • 2021-07-07
  • 2021-10-24
  • 2021-06-09
  • 2021-05-05
  • 2021-07-03
  • 2021-11-08
猜你喜欢
  • 2022-12-23
  • 2021-08-21
  • 2021-06-05
  • 2021-10-02
  • 2021-04-27
相关资源
相似解决方案