我是一名使用Visual Studio 2008內置單元測試組件的新手,在單元測試中記錄或顯示結果的最佳方法是什麼?在VS 2008中顯示單元測試結果
我想測試我的服務方法,當它返回的System.Guid和一個空的System.Guid
[TestMethod]
public void GetGUID()
{
MyWcfServiceService.MyWcfServiceClient proxy = new MyWcfServiceService.MyWcfServiceClient();
string name = "HasGuid";
System.GUID guid = proxy.GetGUID(name);
}
[TestMethod]
public void GetEmptyGUID()
{
MyWcfServiceService.MyWcfServiceClient proxy = new MyWcfServiceService.MyWcfServiceClient();
string name = "HasEmptyGuid";
System.GUID guid = proxy.GetGUID(name);
}
呀其Assert.IsTrue(條件 「消息」)或Assert.XXX( x,「消息」)。 – cfeduke 2008-10-30 21:52:35