-namespace tut
-{
- struct fee_charge_rules_data {
- };
-
- typedef test_group<fee_charge_rules_data> tg;
- tg fee_charge_rules_test_group("Fee charge rules tests group");
-
- typedef tg::object testobject;
-
- class TEST_SETTINGS : public SETTINGS {
- public:
- TEST_SETTINGS(unsigned _feeChargeType)
- : feeChargeType(_feeChargeType) {}
-
- const std::string & GetDirName(size_t) const { return dirName; }
- const std::string & GetScriptsDir() const { return scriptsDir; }
- unsigned GetDetailStatWritePeriod() const { return 10; }
- unsigned GetStatWritePeriod() const { return 10; }
- unsigned GetDayFee() const { return 0; }
- bool GetFullFee() const { return false; }
- unsigned GetDayResetTraff() const { return 0; }
- bool GetSpreadFee() const { return false; }
- bool GetFreeMbAllowInet() const { return false; }
- bool GetDayFeeIsLastDay() const { return false; }
- bool GetWriteFreeMbTraffCost() const { return false; }
- bool GetShowFeeInCash() const { return false; }
- unsigned GetMessageTimeout() const { return 0; }
- unsigned GetFeeChargeType() const { return feeChargeType; }
- const std::string & GetMonitorDir() const { return monitorDir; }
- bool GetMonitoring() const { return false; }
-
- private:
- std::string dirName;
- std::string scriptsDir;
- std::string monitorDir;
- unsigned feeChargeType;
- };
-
- class TEST_TARIFFS : public TARIFFS {
- public:
- TEST_TARIFFS() {}
-
- int ReadTariffs () { return 0; }
- const TARIFF * FindByName(const std::string & name) const { return &testTariff; }
- const TARIFF * GetNoTariff() const { return NULL; }
- int GetTariffsNum() const { return 0; }
- int Del(const std::string & name, const ADMIN * admin) { return 0; }
- int Add(const std::string & name, const ADMIN * admin) { return 0; }
- int Chg(const TARIFF_DATA & td, const ADMIN * admin) { return 0; }
-
- void GetTariffsData(std::list<TARIFF_DATA> * tdl) {}
-
- const std::string & GetStrError() const { return strError; }
-
- void SetFee(double fee);
-
- private:
- std::string strError;
- TARIFF_IMPL testTariff;
- };
-
- class TEST_ADMIN : public ADMIN {
- public:
- TEST_ADMIN() : priv(0xffFFffFF) {}
-
- ADMIN & operator=(const ADMIN &) { return *this; }
- ADMIN & operator=(const ADMIN_CONF &) { return *this; }
- bool operator==(const ADMIN & rhs) const { return true; }
- bool operator!=(const ADMIN & rhs) const { return false; }
- bool operator<(const ADMIN & rhs) const { return true; }
- bool operator<=(const ADMIN & rhs) const { return true; }
-
- const std::string & GetPassword() const { return password; }
- const std::string & GetLogin() const { return login; }
- PRIV const * GetPriv() const { return &priv; }
- uint16_t GetPrivAsInt() const { return priv.ToInt(); }
- const ADMIN_CONF & GetConf() const { return conf; }
- uint32_t GetIP() const { return ip; }
- std::string GetIPStr() const { return inet_ntostring(ip); }
- void SetIP(uint32_t ip) { TEST_ADMIN::ip = ip; }
- const std::string GetLogStr() const { return ""; }
-
- private:
- std::string password;
- std::string login;
- PRIV priv;
- ADMIN_CONF conf;
- uint32_t ip;
- };
-
- class TEST_STORE : public STORE {
- public:
- TEST_STORE() {}
-
- int GetUsersList(std::vector<std::string> * usersList) const { return 0; }
- int AddUser(const std::string & login) const { return 0; }
- int DelUser(const std::string & login) const { return 0; }
- int SaveUserStat(const USER_STAT & stat, const std::string & login) const { return 0; }
- int SaveUserConf(const USER_CONF & conf, const std::string & login) const { return 0; }
- int RestoreUserStat(USER_STAT * stat, const std::string & login) const { return 0; }
- int RestoreUserConf(USER_CONF * conf, const std::string & login) const { return 0; }
-
- int WriteUserChgLog(const std::string & login,
- const std::string & admLogin,
- uint32_t admIP,
- const std::string & paramName,
- const std::string & oldValue,
- const std::string & newValue,
- const std::string & message = "") const { return 0; }
-
- int WriteUserConnect(const std::string & login, uint32_t ip) const { return 0; }
-
- int WriteUserDisconnect(const std::string & login,
- const DIR_TRAFF & up,
- const DIR_TRAFF & down,
- const DIR_TRAFF & sessionUp,
- const DIR_TRAFF & sessionDown,
- double cash,
- double freeMb,
- const std::string & reason) const { return 0; }
-
- int WriteDetailedStat(const TRAFF_STAT & statTree,
- time_t lastStat,
- const std::string & login) const { return 0; }
-
- int AddMessage(STG_MSG * msg, const std::string & login) const { return 0; }
- int EditMessage(const STG_MSG & msg, const std::string & login) const { return 0; }
- int GetMessage(uint64_t id, STG_MSG * msg, const std::string & login) const { return 0; }
- int DelMessage(uint64_t id, const std::string & login) const { return 0; }
- int GetMessageHdrs(vector<STG_MSG_HDR> * hdrsList, const std::string & login) const { return 0; }