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