RSS feed
[root]
/
vendingmachine
/
c04
/
code
/
TI Pattern
/
software design
/
document
login:
password:
title search:
Search this site
Enter your search terms
Web
www.carfield.com.hk
Submit search form
Prev
Next
Wed Dec 26 16:00:00 GMT 2001
VendingMachineTest
//: c04:vendingmachine:VendingMachineTest.java // Demonstrates use of StateMachine.java package c04.vendingmachine; import c04.statemachine2.*; import com.bruceeckel.test.*; public class VendingMachineTest extends UnitTest{ VendingMachine vm = new VendingMachine(); Input[] inputs = { Money.quarter, Money.quarter, Money.dollar, FirstDigit.A, SecondDigit.two, FirstDigit.A, SecondDigit.two, FirstDigit.C, SecondDigit.three, FirstDigit.D, SecondDigit.one, Quit.quit, }; public void test() { for(int i = 0; i < inputs.length; i++) vm.nextState(inputs[i]); } public static void main(String[] args) { new VendingMachineTest().test(); } } ///:~
(google search)
(amazon search)
1
2
3
second
download zip of files only
Prev
Next