This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="row"> | |
<div class="col-md-4 col-md-offset-4"> | |
<div class="row"> | |
<div class="col-md-3"><i class="glyphicon glyphicon-cloud green"></i></div> | |
<div class="col-md-3"><i class="glyphicon glyphicon-envelope green"></i></div> | |
<div class="col-md-3"><i class="glyphicon glyphicon-search green"></i></div> | |
<div class="col-md-3"><i class="glyphicon glyphicon-film green"></i></div> | |
</div> <!-- /.row --> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="row"> | |
<div class="col-*-*"></div> | |
<div class="col-*-*"></div> | |
<!-- You can place as many col-*-* as your like. If there is more | |
than 12 columns, they will be wrapped for you onto a new line --> | |
<div class="col-*-*"></div> | |
</div> <!-- /.row --> | |
<!-- You can place as many col-*-* as your like. --> | |
</div> <!-- /.container--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<form class="form-horizontal" role="form"> | |
<div class="form-group"> | |
<!-- Place here whatever form control you need --> | |
</div> <!-- /.form-group --> | |
<!-- Place as much form groups as you need --> | |
<div class="form-group"> | |
<!-- Place here whatever form control you need --> | |
</div> <!-- /.form-group --> | |
</form> <!-- /form --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<form class="form-horizontal" role="form"> | |
<h2>Registration Form</h2> | |
<div class="form-group"> | |
<label for="firstName" class="col-sm-3 control-label">Full Name</label> | |
<div class="col-sm-9"> | |
<input type="text" id="firstName" placeholder="Full Name" class="form-control" autofocus> | |
<span class="help-block">Last Name, First Name, eg.: Smith, Harry</span> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean isTransactionPossible(final BigDecimal amount, | |
final BigDecimal balance) { | |
return balance.compareTo(amount) >= 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void withdrawCash() throws BankServiceException { | |
//Show user options to withdraw cash | |
screen.displayMenuOfWithdrowalAmounts(); | |
//Read amount from the keypad | |
BigDecimal amount = keypad.getAmount(); | |
//Connect to the bank and check balance | |
BigDecimal balance = bankService.getBalance(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(MockitoJUnitRunner.class) | |
public class ATMTest { | |
private ATM sut; | |
@Mock | |
private BankService bankService; | |
@Mock | |
private CashDispenser cashDispenser; | |
@Mock | |
private DepositSlot depositSlot; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void showBalance() { | |
try { | |
BigDecimal balance = bankService.getBalance(); | |
screen.displayBalance(balance); | |
} catch (BankServiceException e) { | |
screen.displayError(BANK_SERVICE_ERROR); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testShowBalance() throws BankServiceException { | |
//given | |
Mockito.when(bankService.getBalance()) | |
.thenThrow(new BankServiceException()); | |
//when | |
sut.showBalance(); | |
//then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testWithdrawCashNotEnoughMoneyOnAccount() throws BankServiceException { | |
//given | |
BigDecimal amount = new BigDecimal("1000"); | |
BigDecimal balance = new BigDecimal("500"); | |
Mockito.when(keypad.getAmount()).thenReturn(amount); | |
Mockito.when(bankService.getBalance()).thenReturn(balance); | |
Mockito.when(cashDispenser.isThereEnoughMoney(amount)).thenReturn(true); | |
//when |