예제 #1
0
 public void TestEmployee()
 {
     int empId = 1;
     Employee e = new Employee(empId, "Bob", "Home");
     Assert.AreEqual("Bob", e.Name);
     Assert.AreEqual("Home", e.Address);
     Assert.AreEqual(empId, e.EmpId);  
 }
 protected override void RecordMembership(Employee e)
 {
     Affiliation affiliation = e.Affiliation;
     if (affiliation is UnionAffiliation)
     {
         UnionAffiliation unionAffiliation = Affiliation as UnionAffiliation;
         int memberId = unionAffiliation.MemberId;
         PayrollDatabase.RemoveUnionMember(memberId);
     }
 }
예제 #3
0
        public void Execute()
        {
            Employee e = new Employee(empid, name, address);
            PaymentClassification pc = MakeClassification();
            PaymentSchedule ps = MakeSchedule();
            PaymentMethod pm = new HoldMethod();

            e.Classification = pc;
            e.Schedule = ps;
            e.Method = pm;
            PayrollDatabase.AddEmployee(empid, e);
        }
예제 #4
0
 public static void AddEmployee(int id, Employee employee)
 {
     employees[id] = employee;
 }
예제 #5
0
 public static void AddUnionMember(int id, Employee e)
 {
     unionMembers[id] = e;
 }
 protected abstract void RecordMembership(Employee e);
 protected override void Change(Employee e)
 {
     RecordMembership(e);
     Affiliation affiliation = Affiliation;
     e.Affiliation = affiliation;
 }
예제 #8
0
 protected override void Change(Employee e)
 {
     e.Name = newName;
 }
예제 #9
0
 protected override void RecordMembership(Employee e)
 {
     PayrollDatabase.AddUnionMember(memberId, e);
 }
예제 #10
0
 protected override void Change(Employee e)
 {
     e.Address = newAddress;
 }
예제 #11
0
 protected override void Change(Employee e)
 {
     e.Method = Method;
 }
 protected override void Change(Employee e)
 {
     e.Classification = Classification;
     e.Schedule = Schedule;
 }
예제 #13
0
 protected abstract void Change(Employee e);
예제 #14
0
 public void TestEmployeeToString()
 {
     int empId = 1;
     Employee e = new Employee(empId, "TestEmployee", "TestAddress");
     e.ToString();
 }