Example #1
0
        public async Task ChangeUnionMember()
        {
            int empId           = 9;
            AddHourlyEmployee t = new AddHourlyEmployee(empId, "Bill", "Home", 15.25);
            await t.ExecuteAsync();

            int memberId = 7743;
            ChangeMemberTransaction cmt = new ChangeMemberTransaction(empId, memberId, 99.42);
            await cmt.ExecuteAsync();

            Employee e = await PayrollDatabase.GetEmployeeAsync(empId);

            Assert.NotNull(e);
            IAffiliation affiliation = e.Affiliation;

            Assert.NotNull(affiliation);
            Assert.True(affiliation is UnionAffiliation);
            UnionAffiliation uf = affiliation as UnionAffiliation;

            Assert.Equal(99.42, uf.Dues);
            Employee member = await PayrollDatabase.GetUnionMemberAsync(memberId);

            Assert.NotNull(member);
            Assert.Equal(e, member);
        }