space, → | next slide |
← | previous slide |
d | debug mode |
## <ret> | go to slide # |
c | table of contents (vi) |
f | toggle footer |
r | reload slides |
z | toggle help (this) |
void test_ApplicationPresenter_
AllowsNumbersToBeEnteredForTheDivisor() {
ApplicationView_GetDivisor_ExpectAndReturn("21");
ApplicationModel_CheckArgumentFormat
_ExpectAndReturn("21", "3", TRUE);
ApplicationPresenter_DivisorChangedCallback("3");
}
void test_ApplicationPresenter_
DoesNotAllowNonNumbersToBeEnteredForTheDivisor() {
ApplicationView_GetDivisor_ExpectAndReturn("21");
ApplicationModel_CheckArgumentFormat
_ExpectAndReturn("21", "j", FALSE);
ApplicationView_UndoDivisorTextChange_Expect();
ApplicationPresenter_DivisorChangedCallback("j");
}
void ApplicationPresenter_
DivisorChangedCallback(char* new_text) {
if (ApplicationModel_CheckArgumentFormat(
ApplicationView_GetDivisor(), new_text) == FALSE) {
ApplicationView_UndoDivisorTextChange();
}
}
Feature: Ping command
As a server
I want to respond to clients
wondering if I'm online
Scenario: Responding to a ping
Given the server is online
When I ping the server
Then the client should receive
a positive response
When /^I ping the server$/ do
TCPSocket.open(IP, PORT) do |conn|
conn.puts "ping"
@response = conn.gets
end
end
Then /^the client should receive
a positive response$/ do
@response.strip.should == "ACK"
end
Feature: Put and get commands
As a server
...
Scenario: Putting and getting multiple pairs
Given the server is online
When I put the pid "1" with the name "init" for id "abc"
And I put the pid "99" with the name "ps" for id "abc"
And I put the pid "187" with the name "ruby" for id "abc"
When I get the pairs for id "abc"
Then the pid "1" with the name "init" should be returned
And the pid "99" with the name "ps" should be returned
And the pid "187" with the name "ruby" should be returned
When /^I run the client with
parameters "([^"]*)"$/ do |params|
When %+I run client.exe #{params}+
end