00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef MOCKPP_EXPECTATIONCOUNTER_H
00031 #define MOCKPP_EXPECTATIONCOUNTER_H
00032
00033
00034 #include <mockpp/mockpp.h>
00035
00036 #include <mockpp/AbstractExpectation.h>
00037
00038
00039 MOCKPP_NS_START
00040
00041
00045 class MOCKPP_API_DECL0 ExpectationCounter : public AbstractExpectation<unsigned>
00046 {
00047 public:
00048
00053 ExpectationCounter(const String &name, VerifiableList *parent = 0);
00054
00057 virtual void clearActual();
00058
00059
00062 virtual void reset();
00063
00066 void inc();
00067
00068
00072 void setExpected(unsigned expectedCalls);
00073
00074
00079 void setExpected(unsigned expectedMinCalls, unsigned expectedMaxCalls);
00080
00081
00088 void setExpectNothing();
00089
00090
00094 unsigned getActual() const;
00095
00096
00100 virtual void verify();
00101
00102 protected:
00103
00106 virtual void clearExpectation();
00107
00108 private:
00109
00110 unsigned myExpectedMinCalls;
00111 unsigned myExpectedMaxCalls;
00112 unsigned myActualCalls;
00113 bool expectNothing;
00114 };
00115
00116
00117 MOCKPP_NS_END
00118
00119
00120 #endif // MOCKPP_EXPECTATIONCOUNTER_H