다음 코드 실행에 대한 GWT 접근 방식을 사용하여 BDD를 연습하기 시작했으며 두 번째 테스트를 수행 할 수 없다는 것을 깨달았습니다.MSpec을 사용하여 GWT로 BDD하는 방법? 이 시나리오를 작성하는 올바른 방법
내 GWT는
Given there exists an open query
When the user replies to the query
Then it should save the reply if the reply is not blank
같은 것이 그 다음은
그래서 나는 그렇게public class when_user_replies_to_the_query : OpenQuery
{
Because
{
query.Reply(data);
}
ThenIt should_save_the_reply_to_the_database_if_there_is_a_reply
ThenIt should_notify_the_user_if_there_is_no_text_in_the_reply_and_not_save_to_database
}
public class Query
{
void Reply(string data)
{
//do something
}
}
그러나처럼 그것을 코딩이 비어있는 경우 응답을 저장할 사용자에게 통지하고 안 간다 첫 번째 경우에는 데이터에 무언가가 있어야하고 두 번째 경우에는 데이터가 빈 문자열이어야한다는 이유로 두 번째 사례를 수행 할 수 없다는 것을 깨달았습니다.
는이 경우 내가Given the reply is blank
When the user replies to the query
Then it should notify the user ......
처럼 무언가로 내 GWT를 분할해야이 평균이, 그때는 반환 null의 경우 시나리오의 엄청난 금액을 작성하는 것합니까
values being null. Such as
Given the database is null
When retrieving queries
Should reply with error message
When saving queries
Should save to file and reply with error message
When // basically doing anything
Should //give appropriate response
내 BDD 사양을 작성하는 방법은 무엇입니까? 그리고 나는 심지어 올바른 포럼 O_O에 있습니까?