Beispiel #1
0
        public void EmployeeConstructorTest()
        {
            Employee e = new Employee("John", "Doe");
            Assert.IsNotNull(e);

            Assert.AreEqual("John", e.FirstName);
            Assert.AreEqual("Doe", e.LastName);
        }
Beispiel #2
0
        public void AddEmployeeTest()
        {
            Company c = new Company();
            Employee e = new Employee("John", "Doe");

            c.AddEmployee(e);
            Assert.IsTrue(c.GetNumberOfEmployees() == 1);
        }
Beispiel #3
0
        public void GetEmployeePositionTest()
        {
            const string POSITION = "Supervisor";
            Company c = new Company();
            Employee e = new Employee("John", "Doe");
            e.Position = POSITION;

             c.AddEmployee(e);

            Assert.AreEqual(POSITION, c.GetEmployeePosition(e));
        }
Beispiel #4
0
 public void RemoveEmployee(Employee e)
 {
     _employees.Remove(e);
 }
Beispiel #5
0
 public string GetEmployeePosition(Employee key)
 {
     return _employees.Where(e => e.FirstName == key.FirstName &&
         e.LastName == key.LastName).FirstOrDefault().Position;
 }
Beispiel #6
0
 public void AddEmployee(Employee e)
 {
     _employees.Add(e);
 }