我已經構建了一個WebAPI並希望創建一個單元測試項目,以便自動測試我的服務。 我的WebAPI的流程很簡單: 控制器(DI服務) - >服務(DI庫) - > _repo CRUD 假設我有這樣一個服務: public int Cancel(string id) //change status filed to 'n'
{
var item = _repo.Find(id);
我知道有這個問題只顯示方法名稱: How can XUnit be configured to show just the method name in the Visual Studio 2015 Test Explorer? 我嘗試使用XML和JSON文件既解決方案但文本資源管理器窗口中的名稱仍然是該類的全名。我只想顯示方法名稱,因爲它很難讀取完全限定名稱。 及其對本網站說,你可以配置使用XM
我在Visual Studio Test Explorer中使用xUnit,並且在Assert.Equal()中出現錯誤時,我得到Actual和Expected的截斷版本。 例如, Xunit.Sdk.EqualException
Assert.Equal() Failure
Expected: List<Result>
[Result {
Status = StatusEnumValue