Exemplo n.º 1
0
        public void TestAddServiceCharge()
        {
            int empId           = 2;
            AddHourlyEmployee t = new AddHourlyEmployee(empId, "Kubing", "Home", 15.25, database);

            t.Execute();

            Employee e = database.GetEmployee(empId);

            Assert.IsNotNull(e);

            int memberId = 86;

            database.AddUnionMember(memberId, e);

            UnionAffiliation ua = new UnionAffiliation(memberId, 99.52);

            e.Affiliation = ua;

            var date = new DateTime(2005, 8, 8);
            ServiceChargeTransaction sct = new ServiceChargeTransaction(memberId, date, 12.95, database);

            sct.Execute();

            var           serviceCharges = database.GetServiceCharges(memberId);
            ServiceCharge sc             = serviceCharges.FirstOrDefault(x => x.Date == date);

            Assert.IsNotNull(sc);
            Assert.AreEqual(12.95, sc.Amount, 0.001);
        }
Exemplo n.º 2
0
        public void UnionMemberWithOneServiceCharge()
        {
            database.AddEmployee(employee);

            int memberId = 7783;
            ChangeMemberTransaction cmt = new ChangeMemberTransaction(employee.EmpId, memberId, 99.42, database);

            cmt.Execute();

            var date = new DateTime(2005, 8, 8);
            ServiceChargeTransaction sct = new ServiceChargeTransaction(memberId, date, 12.95, database);

            sct.Execute();

            var           serviceCharges = database.GetServiceCharges(memberId);
            ServiceCharge sc             = serviceCharges.FirstOrDefault(x => x.Date == date);

            Assert.IsNotNull(sc);
            Assert.AreEqual(12.95, sc.Amount, 0.001);
        }