|
在软件框架建成后,编写实现代码前,可以先用这个工具生成测试脚本,待实现代码编写完成后对其测试。
如下这段代码,只是生成了框架,还没有编写实现代码:
-------------------------------------------------------
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace XYZInstrumentDrivers
{
/// <summary>
/// XYZ measurement system driver
/// </summary>
[
Guid("C5EA5B79-0C08-4f88-A3EF-FAEF56C44040"),
ClassInterface (ClassInterfaceType.AutoDual)
]
public class XYZDriver
{
/// <summary>
/// Default constructor
/// </summary>
public XYZDriver()
{
}
public int Init(string resourceName, bool idQuery, bool reset)
{
return 0;
}
public void ErrorQuery(ref int errorCode, ref string errorMessage)
{
return;
}
public void ErrorMessage(int statusCode, ref string message)
{
return;
}
public void RevisionQuery(ref string instrumentDriverRevision, ref string firmwareRevision)
{
return;
}
public void Reset()
{
return;
}
public void SelfTest(ref short selfTestResult, ref string selfTestMessage)
{
return;
}
public void TimeOut(int setTimeOut)
{
return;
}
public void Dcl()
{
return;
}
public void exec(string sendStringCommand)
{
return;
}
public void SetPaddlePosition(int paddle, int positionSelector, short optionalPosition)
{
return;
}
public void SetScanRate(int scanSelector, int optionalScanRate)
{
return;
}
public void PaddlePosition(int paddle, short position)
{
return;
}
……
public void RecallState(int saveLoc)
{
return;
}
} //end of class
} //end of namespace
------------------------------------------------
这时可以用AT工具对这些public方法生成测试用例,待实现代码编写完成后可以对其正确性进行测试。
[ Last edited by developing_T on 2005-6-22 at 08:52 ] |
|