1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\extended\bin\Debug\extended.dll
4
5 !|configuration setup|
6 |service|
7 |add operator|extended.CurrencyParser|
8
9 !|DecimalFixture|
10 |field|field?|
11 |$44|44|
DomainWrapper.AlternatingSystemUnderTest
1 !|info.fitnesse.AlternatingSUT|
2
3 !|Define Links|
4 |Name|Url|Id?|
5 |Google|http://www.google.com|>>google|
6 |Yahoo|http://www.yahoo.com|>>yahoo|
7 |Microsoft|http://www.microsoft.com|>>msft|
8 !|Check Links|
9 |Id|Name?|Url?|
10 |<
DomainWrapper.FlowCollections
1 !|info.fitnesse.FlowCollections|
2
3 !|Define Links|
4 |Name|Url|
5 |Google|http://www.google.com|
6 |Yahoo|http://www.yahoo.com|
7
8
9 !|List Links|
10 |Name|Url|
11 |Google|http://www.google.com|
12 |Yahoo|http://www.yahoo.com|
1 !-FitNesse-! .NET tips & tricks
2
3
4 >FlowCollections
5 >SystemUnderTest
6 >WithSystemUnderTest
7 >NamingSystemUnderTests
8 ----
9 >TargetObject
10 >SystemUnderTestColumnFixture
11 >AlternatingSystemUnderTest
12 ----
13 >AutomaticDomainObjectWrappingWithHandlers
14 ---
15 >SuiteConfigFile
DomainWrapper.NamingSystemUnderTests
1 !*> setup
2 !|info.fitnesse.AutomaticDomainObjectWrapping|
3
4 |import|
5 |info.fitnesse|
6
7 !|name|google|with|new|Link|Google|http://www.google.com|
8
9 !|name|yahoo|with|new|Link|Yahoo|http://www.yahoo.com|
10
11 *!
12
13 |use|google|
14 |check|valid|true|
15
16 |use|yahoo|
17 |check|valid|true|
DomainWrapper.SystemUnderTest
1 !|info.fitnesse.FlowSystemUnderTest|
2
3 !|Define Links|
4 |Name|Url|
5 |Google|http://www.google.com|
6 |Yahoo|http://www.yahoo.com|
7
8
9 !|Find All|
10 |Name|Url|
11 |Google|http://www.google.com|
12 |Yahoo|http://www.yahoo.com|
DomainWrapper.SystemUnderTestColumnFixture
1 |import|
2 |info.fitnesse.sut|
3
4 Link validity check
5
6 Valid links have to contain a URL and a name, and the URL must contain the sequence ://
7
8 Examples
9
10 !|Link validity check|
11 |name|url|valid?|comment|
12 |google|http://www.google.com|true|both set, correct|
13 |blank|http://www.google.com|false|name not set|
14 |google|blank|false|url not set|
15 |google|www.google.com|false|url not in correct format|
16
DomainWrapper.TargetObject
1 |import|
2 |info.fitnesse.to|
3
4 Link validity check
5
6 Valid links have to contain a URL and a name, and the URL must contain the sequence ://
7
8 Examples
9
10 !|Link validity check|
11 |name|url|valid?|
12 |google|http://www.google.com|true|
13 |blank|http://www.google.com|false|
14 |google|blank|false|
15 |google|www.google.com|false|
DomainWrapper.WithSystemUnderTest
1 !|info.fitnesse.WithSystemUnderTest|
2
3 !|with|new|info.fitnesse.MemoryLinkRepository|
4
5 !|Define Links|
6 |Name|Url|
7 |Google|http://www.google.com|
8 |Yahoo|http://www.yahoo.com|
9
10 !|Find All|
11 |Name|Url|
12 |Google|http://www.google.com|
13 |Yahoo|http://www.yahoo.com|
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3
4 !path D:\work\fitnesse\domain\bin\Release\domain.dll
5
6
7 !contents -R
1 !c !3 Welcome to the Wonderful World of !-FitNesse-!!
2
3 HelloWorld
4
5 PrizeCalculationFirstTry
6 NicerPrizeCalculation
7
8 PlayerRegistrationFirstTry
9 PlayerRegistrationSecondTry
10 PlayerRegistrationThirdTry
11
12 PurchaseTicketFirstTry
13 PurchaseTicketSecondTry
14 PurchaseTicketNotEnoughMoney
15 PurchaseTicketSuite
16
17 SettlementTests
18
19 TicketReviewTests
20 TicketReviewTestsWithRowFixture
21
22 LoginTest
23
24 InvoiceTable
25 CustomParsing
26
27 DomainWrapper
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\HelloWorld\bin\Release\HelloWorld.dll
4
5 !|HelloWorld.OurFirstTest|
6 |string1|string2|Concatenate?|
7 |Hello|World|Hello World|
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\extended\bin\Release\extended.dll
4
5
6 |import|
7 |extended|
8
9 !-
10 | Invoice |
11 | Item | Product code | Price |
12 | Pragmatic Programmer | B978-0201616224 | 34.03 |
13 | Sony RDR-GX330 | ERDR-GX330 | 94.80 |
14 | Test Driven Development By Example | B978-0321146533 | 32.39 |
15 | Net Total | | 161.22 |
16 | Tax (10% on applicable items) | | 9.48 |
17 | Total | | 170.70 |
18
19 -!
1 !|webfixture.WebTest|
2
3 !|Start Browser|*iehta|With Selenium Console On| localhost| At Port |4444|And Scripts At|http://localhost:7711|
4
5 |User Opens URL|http://localhost:7711/login.aspx|
6 |User types|testuser|into|username|field|
7 |User types|testpassword|into|password|field|
8
9 |User clicks on|Log In|
10 |Page reloads in less than|3|seconds|
11 |Page contains text|You have logged in|
12
13 |Shutdown browser|
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !|Import|
6 |Tristan.Test|
7
8 The prize pool is divided among the winners using the following distribution for winning combinations (number of correct hits out of six chosen numbers). Example below is for $2M payout pool.
9
10 !|Prize Distribution for Payout Pool|2,000,000|
11 |Winning Combination|Pool Percentage?|Prize Pool?|
12 |6|68|1,360,000|
13 |5|10|200,000|
14 |4|10|200,000|
15 |3|12|240,000|
PlayerRegistrationFirstTry
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !|import|
6 |Tristan.Test|
7 |Tristan.Test.FirstTry|
8 !3 Upon registration, player details are stored correctly in the system, the player can log in, and the balance on his account is 0
9 !|Set Up Test Environment|
10
11 !|Player Registers|
12 |username|password|player id?|
13 |johnsmith|test123|>>player|
14
15 !|Check Stored Details|
16 |player id|username?|balance?|
17 |<PlayerRegistrationSecondTry
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !|import|
6 |Tristan.Test|
7 |Tristan.Test.SecondTry|
8
9 !|Set Up Test Environment|
10 !3 Upon registration, player details are stored correctly in the system, the player can log in, and the balance on his account is 0
11 |Player Registers|
12 |username|password|name|address|city|postcode|country|player id?|
13 |johnsmith|test123|John Smith|44 Ranelagh Way|London|NN1EE1|UK|>>player|
14
15 |Check Stored Details For |player|
16 |username?|name?|address?|city?|postcode?|country?|balance?|
17 |johnsmith|John Smith|44 Ranelagh Way|London|NN1EE1|UK|0|
18
19 |Check Log In|
20 |username|password|logged in as player id?|
21 |johnsmith|test123|<PlayerRegistrationThirdTry
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !|import|
6 |Tristan.Test|
7 |Tristan.Test.SecondTry|
8
9 |Set Up Test Environment|
10 !3 Player cannot register if the requested username already exists
11 |Player Registers|
12 |username|password|name|address|city|postcode|country|player id?|
13 |johnsmith|test123|John Smith|44 Ranelagh Way|London|NN1EE1|UK|>>player|
14 |johnsmith|test334|Smith2|55 Ranelagh Way|London|NN2EE2|UK|exception["Duplicate username"]|
15 !3 Player cannot log-in with an incorrect password
16 |Check Log In|
17 |username|password|logged in as player id?|
18 |johnsmith|test123|<
1 !define COMMAND_PATTERN {%m %p}
2 !define TEST_RUNNER {dotnet2\FitServer.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !|Import|
6 |Tristan.Test|
7
8 !|Payout Table|
9 |Payout Pool|Winning Combination|Pool Percentage?|Prize Pool?|
10 |2,000,000|6|68|1,360,000|
11 |2,000,000|5|10|200,000|
12 |2,000,000|4|10|200,000|
13 |2,000,000|3|12|240,000|
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4 !|Tristan.Test.PayoutTable|
5 |payoutPool|winningCombination|PoolPercentage?|PrizePool?|
6 |2000000|6|68|1360000|
7 |2000000|5|10|200000|
8 |2000000|4|10|200000|
9 |2000000|3|12|240000|
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !|import|
6 |Tristan.Test.PurchaseTicket|
7
8 |Set Up Test Environment|
9 |Create Draw|
10 |01/01/2008|
11
12 |Player Registers|
13 |username|password|name|address|city|postcode|country|player id?|
14 |john|test123|John Smith|44 Ranelagh Way|London|NN1EE1|UK|>>player|
15
16 !3 A player registers, transfers money into the account and purchases a ticket. The ticket should be registered for the correct draw in the system, and the account balance and pool size will be adjusted for the ticket value
17
18 |Purchase Ticket|
19 |Player|john|Deposits|100|dollars with card|4111111111111111|and expiry date|01/12|
20 |Player|john|has|100|dollars|
21 |Player|john|buys a ticket with numbers|1,3,4,5,8,10| for draw on |01/01/2008|
22 |Pool value for draw on |01/01/2008|is|10|dollars|
23 |Player|john|has|90|dollars|
24 |Ticket with numbers|1,3,4,5,8,10| for |10| dollars is registered for player|john| for draw on |01/01/2008|
PurchaseTicketNotEnoughMoney
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !|import|
6 |Tristan.Test.PurchaseTicket|
7
8 |Set Up Test Environment|
9 |Create Draw|
10 |01/01/2008|
11
12 |Player Registers|
13 |username|password|name|address|city|postcode|country|player id?|
14 |john|test123|John Smith|44 Ranelagh Way|London|NN1EE1|UK|>>player|
15 !3 When there is not enough money in the account, the ticket purchase should be refused. The ticket should not be registered, account balance and pool value remain untouched.
16 |Purchase Ticket|
17 |Player|john|Deposits|50|dollars with card|4111111111111111|and expiry date|01/12|
18 |reject|Player|john|buys|10| tickets with numbers|1,3,4,5,8,10| for draw on |01/01/2008|
19 |Check|Pool value for draw on |01/01/2008|is|0|
20 |Check|Account balance for |john|50|
21 |Check|Tickets in draw on |01/01/2008|0|
22 |not|Ticket with numbers|1,3,4,5,8,10| for |100| dollars is registered for player|john| for draw on |01/01/2008|
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !|import|
6 |Tristan.Test.PurchaseTicket|
7
8 |Set Up Test Environment|
9 |Create Draw|
10 |01/01/2008|
11
12 |Player Registers|
13 |username|password|name|address|city|postcode|country|player id?|
14 |john|test123|John Smith|44 Ranelagh Way|London|NN1EE1|UK|>>player|
15 !3 A player registers, transfers money into the account and purchases a ticket. The ticket should be registered for the correct draw in the system, and the account balance and pool size will be adjusted for the ticket value
16 |Purchase Ticket|
17 |Player|john|Deposits|100|dollars with card|4111111111111111|and expiry date|01/12|
18 |Player|john|has|100|dollars|
19 |Player|john|buys a ticket with numbers|1,3,4,5,8,10| for draw on |01/01/2008|
20 |Check|Pool value for draw on |01/01/2008|is|10|
21 |Check|Account balance for |john|90|
22 |Ticket with numbers|1,3,4,5,8,10| for |10| dollars is registered for player|john| for draw on |01/01/2008|
PurchaseTicketSuite.BasicCase
1 !3 A player registers, transfers money into the account and purchases a ticket. The ticket should be registered for the correct draw in the system, and the account balance and pool size will be adjusted for the ticket value
2 |Purchase Ticket|
3 |Player|john|Deposits|100|dollars with card|4111111111111111|and expiry date|01/12|
4 |Player|john|has|100|dollars|
5 |Player|john|buys a ticket with numbers|1,3,4,5,8,10| for draw on |01/01/2008|
6 |Check|Pool value for draw on |01/01/2008|is|10|
7 |Check|Account balance for |john|90|
8 |Ticket with numbers|1,3,4,5,8,10| for |10| dollars is registered for player|john| for draw on |01/01/2008|
PurchaseTicketSuite.NotEnoughMoney
1 !3 When there is not enough money in the account, the ticket purchase should be refused. The ticket should not be registered, account balance and pool value remain untouched.
2 |Purchase Ticket|
3 |Player|john|Deposits|50|dollars with card|4111111111111111|and expiry date|01/12|
4 |reject|Player|john|buys|10| tickets with numbers|1,3,4,5,8,10| for draw on |01/01/2008|
5 |Check|Pool value for draw on |01/01/2008|is|0|
6 |Check|Account balance for |john|50|
7 |Check|Tickets in draw on |01/01/2008|0|
8 |not|Ticket with numbers|1,3,4,5,8,10| for |100| dollars is registered for player|john| for draw on |01/01/2008|
PurchaseTicketSuite.SetUp
1 !|import|
2 |Tristan.Test.PurchaseTicket|
3
4 |Set Up Test Environment|
5 |Create Draw|
6 |01/01/2008|
7
8 |Player Registers|
9 |username|password|name|address|city|postcode|country|player id?|
10 |john|test123|John Smith|44 Ranelagh Way|London|NN1EE1|UK|>>player|
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !contents -R
PurchaseTicketWithVariable
1 !define COMMAND_PATTERN {%m %p}
2 !define TEST_RUNNER {dotnet2\FitServer.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !define username {john}
6
7 !|import|
8 |Tristan.Test.PurchaseTicket|
9
10 |Set Up Test Environment|
11 |Create Draw|
12 |01/01/2008|
13 |02/01/2008|
14
15 |Player Registers|
16 |username|password|name|address|city|postcode|country|new player id?|
17 |john|test123|John Smith|44 Ranelagh Way|London|NN1EE1|UK|>>player|
18 !3 A player registers, transfers money into the account and purchases a ticket. The ticket should be registered for the correct draw in the system, and the account balance and pool size will be adjusted for the ticket value
19 |Purchase Ticket|
20 |Player|${username}|Deposits|100|dollars with card|4111111111111111|and expiry date|01/12|
21 |Player|${username}|has|100|dollars|
22 |Player|${username}|buys a ticket with numbers|1,3,4,5,8,10| for |10| dollars for draw on |01/01/2008|
SettlementTests.OneWinnerSixBallsFirstTry
1 !3 Arthur guessed all 6 balls correctly, so he takes the entire 6 out of 6 prize
2
3 |Tickets in the Draw|
4 |player|numbers|value|
5 |Ford|2,11,22,33,39,18|50|
6 |Arthur|1,5,4,7,9,20|50|
7 |Trisha|10,21,30,6,16,26|50|
8 |Marvin|12,13,14,15,16,17|50|
9
10 |Draw results are|1,5,4,20,9,7|
11
12 |Accounts after the Draw|
13 |Player|Balance?|
14 |Arthur|118|
15 |Ford|50|
16 |Trisha|50|
17 |Marvin|50|
1 !|Tristan.Test.Settlement.SettlementTest|
2
3 |Accounts before the draw|
4 |player|balance|
5 |Arthur|100|
6 |Ford|100|
7 |Trisha|100|
8 |Marvin|100|
SettlementTests.TwoWinnersFourBalls
1 !3 Arthur and Trisha guess 4 balls correctly (1,5,4,20). Arthur bet 80 dollars, Trisha bet 20, so the prize is split 4/1
2
3 |Tickets in the Draw|
4 |player|numbers|value|
5 |Ford|2,11,22,33,39,18|50|
6 |Arthur|1,5,4,7,9,20|80|
7 |Trisha|10,1,20,5,4,11|20|
8 |Marvin|12,13,14,15,16,17|50|
9
10 |Draw results are|1,5,4,20,38,37|
11
12 |Accounts after the Draw|
13 |Player|Balance?|
14 |Arthur|28|
15 |Ford|50|
16 |Trisha|82|
17 |Marvin|50|
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !contents -R
1 !|Tristan.Test.ReviewTickets|
2
3 |Draw on |01/01/2008| is open|
4
5 |Player | john | opens account with | 100 | dollars|
TicketReviewTests.SeveralTicketsOneDraw
1 |Player|john|buys a ticket with numbers|1,3,4,5,8,10|for draw on|01/01/2008|
2
3 |Player|john|buys a ticket with numbers|2,4,5,8,10,12|for draw on|01/01/2008|
4
5 |Player|john|buys|5|tickets with numbers|3,6,9,12,15,18|for draw on|01/01/2008|
6
7 |Player|john|lists open tickets|
8 |draw|numbers|value|
9 |01/01/2008|1,3,4,5,8,10|10|
10 |01/01/2008|2,4,5,8,10,12|10|
11 |01/01/2008|3,6,9,12,15,18|50|
TicketReviewTests.SeveralTicketsTwoDraws
1 |Draw on|02/01/2008|is open|
2
3 |Draw on|03/01/2008|is open|
4
5 |Player|john|buys a ticket with numbers|1,3,4,5,8,10|for draw on|02/01/2008|
6
7 |Player|john|buys a ticket with numbers|1,3,4,5,8,10|for draw on|01/01/2008|
8
9 |Player|john|buys|5|tickets with numbers|3,6,9,12,15,18|for draw on|01/01/2008|
10
11 |Player|john|lists tickets for draw on|01/01/2008|
12 |value|numbers|
13 |10|1,3,4,5,8,10|
14 |50|3,6,9,12,15,18|
15
16 |Player|john|lists tickets for draw on|02/01/2008|
17 |value|numbers|
18 |10|1,3,4,5,8,10|
19
20 |Player|john|lists tickets for draw on|03/01/2008|
21 |value|numbers|
TicketReviewTests.TwoAccountsOneDraw
1 |Player|tom|opens account with|50|dollars|
2
3 |Player|john|buys a ticket with numbers|1,3,4,5,8,10|for draw on|01/01/2008|
4
5 |Player|tom|buys a ticket with numbers|2,4,5,8,10,12|for draw on|01/01/2008|
6
7 |Player|john|lists tickets for draw on|01/01/2008|
8 |value|numbers|
9 |10|1,3,4,5,8,10|
10
11 |Player|tom|lists tickets for draw on|01/01/2008|
12 |value|numbers|
13 |10|2,4,5,8,10,12|
TicketReviewTests.WinningsRecordedCorrectly
1 |Draw on|02/01/2008|is open|
2
3 |Player|john|buys a ticket with numbers|1,3,4,5,8,10|for draw on|01/01/2008|
4
5 |Player|john|buys a ticket with numbers|1,3,4,5,8,10|for draw on|02/01/2008|
6
7 |Player|john|buys|5|tickets with numbers|3,6,9,12,15,18|for draw on|01/01/2008|
8
9 |Numbers|1,3,4,5,31,32|are drawn on|01/01/2008|
10
11 |Player|john|lists tickets for draw on|01/01/2008|
12 |value|numbers|is open|winnings|
13 |10|1,3,4,5,8,10|false|3|
14 |50|3,6,9,12,15,18|false|0|
15
16 |Player|john|lists open tickets|
17 |draw|value|numbers|
18 |02/01/2008|10|1,3,4,5,8,10|
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !contents -R
TicketReviewTestsWithRowFixture
1 !define COMMAND_PATTERN {%m -r fitnesse.fitserver.FitServer,dotnet2\fit.dll %p}
2 !define TEST_RUNNER {dotnet2\Runner.exe}
3 !path D:\work\fitnesse\Tristan\bin\Release\Tristan.dll
4
5 !|Tristan.Test.ReviewTicketsWithRowFixture|
6
7 |Draw on |01/01/2008| is open|
8
9 |Player | john | opens account with | 100 | dollars|
10
11 |Player|john| buys a ticket with numbers |1,3,4,5,8,10 | for draw on |01/01/2008|
12
13 |Player|john| buys a ticket with numbers |2,4,5,8,10,12 | for draw on |01/01/2008|
14
15 |Player|john| buys | 5 | tickets with numbers |3,6,9,12,15,18 | for draw on |01/01/2008|
16
17 |Player|john| lists open tickets |
18 |draw|numbers|value?|
19 |01/01/2008|1,3,4,5,8,10|10|
20 |01/01/2008|2,4,5,8,10,12|10|
21 |01/01/2008|3,6,9,12,15,18|50|
fitnesse/FitNesseRoot/content.txt
1 !contents -R