TEST(ServiceChargeTransactionTest, PayrollTest) { int empid = 7; AddHourlyEmployee ahe(empid, "Test7", "Home7", 50.00); ahe.Execute(); Employee *e = ((DatabaseProxy *)getInstance())->GetEmployee(empid); EXPECT_TRUE(e != 0); Affiliation * af(new UnionAffiliation()); e->SetAffilication(af); int memberId = 86; ((DatabaseProxy *)getInstance())->AddUnionMember(memberId, e); Date date(2005, 8, 8); ServiceChargeTransaction sct(memberId, date, 12.95); sct.Execute(); e = ((DatabaseProxy *)getInstance())->GetEmployee(empid); UnionAffiliation* uf = dynamic_cast<UnionAffiliation*>(e->GetAffilication()); EXPECT_TRUE(uf != 0); ServiceCharge sc = uf->GetServiceCharge(date); EXPECT_TRUE(sc.GetAmount() == 12.95); }