1- using NUnit . Framework ;
1+ using Shouldly ;
2+ using Xunit ;
23
34namespace TestStack . BDDfy . Samples . Atm
45{
@@ -7,8 +8,8 @@ public class AccountHasInsufficientFund
78 private Card _card ;
89 private Atm _atm ;
910
10- // You can override step text using executable attributes
11- [ Given ( "Given the Account Balance is $10" ) ]
11+ // You can override step text using executable attributes
12+ [ Given ( "Given the Account Balance is $10" ) ]
1213 void GivenTheAccountBalanceIs10 ( )
1314 {
1415 _card = new Card ( true , 10 ) ;
@@ -23,34 +24,34 @@ void AndGivenTheMachineContainsEnoughMoney()
2324 _atm = new Atm ( 100 ) ;
2425 }
2526
26- [ When ( "When the Account Holder requests $20" ) ]
27+ [ When ( "When the Account Holder requests $20" ) ]
2728 void WhenTheAccountHolderRequests20 ( )
2829 {
2930 _atm . RequestMoney ( _card , 20 ) ;
3031 }
3132
3233 void Then_the_ATM_should_not_dispense_any_Money ( )
3334 {
34- Assert . AreEqual ( 0 , _atm . DispenseValue ) ;
35+ _atm . DispenseValue . ShouldBe ( 0 ) ;
3536 }
3637
3738 void And_the_ATM_should_say_there_are_Insufficient_Funds ( )
3839 {
39- Assert . AreEqual ( DisplayMessage . InsufficientFunds , _atm . Message ) ;
40+ _atm . Message . ShouldBe ( DisplayMessage . InsufficientFunds ) ;
4041 }
4142
42- [ AndThen ( "And the Account Balance should be $20" ) ]
43+ [ AndThen ( "And the Account Balance should be $20" ) ]
4344 void AndTheAccountBalanceShouldBe20 ( )
4445 {
45- Assert . AreEqual ( 10 , _card . AccountBalance ) ;
46+ _card . AccountBalance . ShouldBe ( 10 ) ;
4647 }
4748
4849 void And_the_Card_should_be_returned ( )
4950 {
50- Assert . IsFalse ( _atm . CardIsRetained ) ;
51+ _atm . CardIsRetained . ShouldBe ( false ) ;
5152 }
5253
53- [ Test ]
54+ [ Fact ]
5455 public void Verify ( )
5556 {
5657 this . BDDfy < AccountHolderWithdrawsCash > ( ) ;
0 commit comments