We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
測試案例完成地不錯,幾個建議:
public void CalculateSumTest_傳入Null物件會例外錯誤(){}
ShouldNotThrow()
IEnumerable<T>
可以參考一下我的 sample code: https://gist.github.com/hatelove/f5a4c2591293828b637f#file-getsumbypagesize_v2-cs
重點 focus 在下列幾點:
這個 homework 基本上有四種方式來實作,也考驗著對 C# 的熟悉程度。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
測試案例完成地不錯,幾個建議:
public void CalculateSumTest_傳入Null物件會例外錯誤(){}
, assert 如果是 exception, expected 就不需要額外寫一個空的,反而是 noise.public void CalculateSumTest_傳入Null物件會例外錯誤(){}
測試案例是說傳 null 會引發 exception, 但測試程式內容卻是ShouldNotThrow()
, 而且ShouldNotThrow()
針對 ArgumentOutOfRangeException 更是不知所謂。IEnumerable<T>
直接擴充,讓用的人更簡單呼叫。另外,這個需求的本質是「分頁取某欄位值總和」,所以使用 LINQ 的 Skip() + Take() + Sum() + yield return 就可以完成。結論
可以參考一下我的 sample code: https://gist.github.com/hatelove/f5a4c2591293828b637f#file-getsumbypagesize_v2-cs
重點 focus 在下列幾點:
這個 homework 基本上有四種方式來實作,也考驗著對 C# 的熟悉程度。
The text was updated successfully, but these errors were encountered: