Invoke .NET assembly library members for Unit Test.
| NUnit test case method on NUTestCase.dll | Target test method on TargetTest.dll | TUnit test case method on TUTestCase.dll |
| NUnit GUI load all method with attribute [Test] on NUTestCase.dll, run it, and display result of method Assert.AreEqual(). |
Target test method invoke from TestCaseMethod1(). | TUnit invoke TestCaseMethod1() on TUTestCase.dll that call Method1() on TUTestCase.dll passing some parameters. |
|
[Test] public void TestCaseMethod1() { TargetTestDll.Class1 ttd = new TargetTestDll.Class1(); bool ret = ttd.Method1("Hello",15); Assert.AreEqual(true, ret); } |
public bool Method1(string str, int i) { if (str = = "Hello" && i = = 15) {return true;}//do some work else {return false;} } |
public bool TestCaseMethod1(string str, int i) { TargetTestDll.Class1 ttd = new TargetTestDll.Class1(); bool ret = ttd.Method1(str,i); return ret; } |