]> git.stg.codes - stg.git/blob - tests/testtariffs.h
Test admin, settings, tariffs and store moved to separate files
[stg.git] / tests / testtariffs.h
1 #ifndef __TEST_TARIFFS_H__
2 #define __TEST_TARIFFS_H__
3
4 #include "stg/tariffs.h"
5
6 #include "tariff_impl.h"
7
8 class TEST_TARIFFS : public TARIFFS {
9     public:
10         TEST_TARIFFS() {}
11
12         int            ReadTariffs () { return 0; }
13         const TARIFF * FindByName(const std::string & name) const { return &testTariff; }
14         const TARIFF * GetNoTariff() const { return NULL; }
15         int            GetTariffsNum() const { return 0; }
16         int            Del(const std::string & name, const ADMIN * admin) { return 0; }
17         int            Add(const std::string & name, const ADMIN * admin) { return 0; }
18         int            Chg(const TARIFF_DATA & td, const ADMIN * admin) { return 0; }
19
20         void           GetTariffsData(std::list<TARIFF_DATA> * tdl) {}
21
22         const std::string & GetStrError() const { return strError; }
23
24         void           SetFee(double fee);
25
26     private:
27         std::string strError;
28         TARIFF_IMPL testTariff;
29 };
30
31 inline
32 void TEST_TARIFFS::SetFee(double fee)
33 {
34     TARIFF_DATA td(testTariff.GetTariffData());
35     td.tariffConf.fee = fee;
36     testTariff = td;
37 }
38
39 #endif