Example #1
0
        public void ChangeUnionMember()
        {
            int empid           = 16;
            AddHourlyEmployee t = new AddHourlyEmployee(empid, "Bob", "Home", 256.1);

            t.Execute();
            int memberId = 7743;
            ChangeMemberTransaction cmt = new ChangeMemberTransaction(empid, memberId, 99.42);

            cmt.Execute();
            Employee e = PayrollDatabase.GetEmployee_Static(empid);

            Assert.IsNotNull(e);
            Affiliation affiliation = e.Affiliation;

            Assert.IsNotNull(affiliation);
            Assert.IsTrue(affiliation is UnionAffiliation);
            UnionAffiliation uf = affiliation as UnionAffiliation;

            Assert.AreEqual(99.42, uf.Charge, .001);
            Employee member = PayrollDatabase.GetUnionMember_Static(memberId);

            Assert.AreEqual(e, member);
        }