-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathAccountHasInsufficientFund.cs
More file actions
67 lines (56 loc) · 1.63 KB
/
AccountHasInsufficientFund.cs
File metadata and controls
67 lines (56 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using Shouldly;
using Xunit;
namespace TestStack.BDDfy.Samples.Atm
{
public class AccountHasInsufficientFund
{
private Card _card;
private Atm _atm;
// You can override step text using executable attributes
[Given("Given the Account Balance is $10")]
internal void GivenTheAccountBalanceIs10()
{
_card = new Card(true, 10);
}
internal void And_given_the_Card_is_valid()
{
}
internal void AndGivenTheMachineContainsEnoughMoney()
{
_atm = new Atm(100);
}
[When("When the Account Holder requests $20")]
internal void WhenTheAccountHolderRequests20()
{
_atm.RequestMoney(_card, 20);
}
internal void Then_the_ATM_should_not_dispense_any_Money()
{
_atm.DispenseValue.ShouldBe(0);
}
internal void And_the_ATM_should_say_there_are_Insufficient_Funds()
{
_atm.Message.ShouldBe(DisplayMessage.InsufficientFunds);
}
[AndThen("And the Account Balance should be $20")]
internal void AndTheAccountBalanceShouldBe20()
{
_card.AccountBalance.ShouldBe(10);
}
internal void And_the_Card_should_be_returned()
{
_atm.CardIsRetained.ShouldBe(false);
}
[Fact]
public void Verify()
{
this.BDDfy<AccountHolderWithdrawsCash>();
}
[Fact]
public void VerifyLazy()
{
var engine = this.LazyBDDfy<AccountHolderWithdrawsCash>();
engine.Run();
}
}
}