私はasp.net mvcアプリケーションに取り組んでおり、ユニットテストBDDスタイルを書いています。例えば。
GetResource_WhenResourceFileExists_ShouldReturnResources()
しかし、コントローラーのテストを書いているときは、通常、同じ名前の 2 つのメソッドがあります。1 つは get リクエスト用のパラメーターなしで、もう 1 つは投稿用です。この 2 つを区別するための適切な命名規則を持っている人はいますか?
私は考えることができます:
1.
LogIn_WithParameters_ShouldReturnLogInView()
LogIn_WithoutParameters_WhenAuthenticationFailed_ShouldReturnLogInView()
LogIn_WithoutParameters_WhenAuthenticationPassed_ShouldReturnProfileRedirect()
2.
LogIn_Get_ShouldReturnLogInView()
LogIn_Post_WhenAuthenticationFailed_ShouldReturnLogInView()
LogIn_Post_WhenAuthenticationPassed_ShouldReturnProfileRedirect()
3.
LogIn_ShouldReturnLogInView()
LogIn_WhenCalledWithParametersAndAuthenticationFailed_ShouldReturnLogInView()
LogIn_WhenCalledWithParametersAndAuthenticationPassed_ShouldReturnProfileRedirect()
ご意見はありますか?