Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.mockobjects.examples.calcserver
Class MockCalculator  view MockCalculator download MockCalculator.java

java.lang.Object
  extended bycom.mockobjects.MockObject
      extended bycom.mockobjects.examples.calcserver.MockCalculator
All Implemented Interfaces:
IntCalculator, com.mockobjects.Verifiable

public class MockCalculator
extends com.mockobjects.MockObject
implements IntCalculator


Field Summary
private  java.lang.String myBadOperation
           
private  com.mockobjects.ExpectationValue myOperation
           
private  int myResult
           
private  com.mockobjects.ExpectationValue myValue1
           
private  com.mockobjects.ExpectationValue myValue2
           
 
Constructor Summary
MockCalculator()
          MockCalculator constructor comment.
 
Method Summary
 int calculate(int value1, int value2, java.lang.String operation)
           
 void setExpectedCalculation(int value1, int value2, java.lang.String operation)
           
 void setupResult(int result)
           
 void setupThrowBadOperation(java.lang.String opName)
           
 void verify()
          Throw an AssertionFailedException if any expectations have not been met.
 
Methods inherited from class com.mockobjects.MockObject
assertEquals, assertEquals, assertTrue, fail, notImplemented, notYetImplemented, notYetImplemented
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myResult

private int myResult

myValue1

private com.mockobjects.ExpectationValue myValue1

myValue2

private com.mockobjects.ExpectationValue myValue2

myOperation

private com.mockobjects.ExpectationValue myOperation

myBadOperation

private java.lang.String myBadOperation
Constructor Detail

MockCalculator

public MockCalculator()
MockCalculator constructor comment.

Method Detail

calculate

public int calculate(int value1,
                     int value2,
                     java.lang.String operation)
              throws CalculatorException
Specified by:
calculate in interface IntCalculator

setExpectedCalculation

public void setExpectedCalculation(int value1,
                                   int value2,
                                   java.lang.String operation)

setupResult

public void setupResult(int result)

setupThrowBadOperation

public void setupThrowBadOperation(java.lang.String opName)

verify

public void verify()
Description copied from interface: com.mockobjects.Verifiable
Throw an AssertionFailedException if any expectations have not been met.

Specified by:
verify in interface com.mockobjects.Verifiable