3 #include "stg/settings.h"
4 #include "stg/user_property.h"
7 const volatile time_t stgTime = 0;
11 struct fee_charge_rules_data {
14 typedef test_group<fee_charge_rules_data> tg;
15 tg fee_charge_rules_test_group("Fee charge rules tests group");
17 typedef tg::object testobject;
19 class TEST_SETTINGS : public SETTINGS {
21 TEST_SETTINGS(unsigned _feeChargeType)
22 : feeChargeType(_feeChargeType) {}
24 const std::string & GetDirName(size_t) const { return dirName; }
25 const std::string & GetScriptsDir() const { return scriptsDir; }
26 unsigned GetDetailStatWritePeriod() const { return 10; }
27 unsigned GetStatWritePeriod() const { return 10; }
28 unsigned GetDayFee() const { return 0; }
29 bool GetFullFee() const { return false; }
30 unsigned GetDayResetTraff() const { return 0; }
31 bool GetSpreadFee() const { return false; }
32 bool GetFreeMbAllowInet() const { return false; }
33 bool GetDayFeeIsLastDay() const { return false; }
34 bool GetWriteFreeMbTraffCost() const { return false; }
35 bool GetShowFeeInCash() const { return false; }
36 unsigned GetMessageTimeout() const { return 0; }
37 unsigned GetFeeChargeType() const { return feeChargeType; }
38 const std::string & GetMonitorDir() const { return monitorDir; }
39 bool GetMonitoring() const { return false; }
43 std::string scriptsDir;
44 std::string monitorDir;
45 unsigned feeChargeType;
50 void testobject::test<1>()
52 set_test_name("Check classic rules");
54 TEST_SETTINGS settings(0);
55 USER_IMPL user(&settings, NULL, NULL, NULL, NULL);
57 USER_PROPERTY<double> & cash(user.GetProperty().cash);
59 ensure_equals("user.cash == 0", user.GetProperty().cash, 0);
61 ensure_equals("user.cash == 0", user.GetProperty().cash, 100);