public void TestEmployeeFullName()
        {
            Database database = new Database();
            Employee employee1 = new Employee("Jeff", "Test", "EIO987", "Brookfield");

            database.Append(employee1);
            
            List<Employee> EmployeeList = database.SelectAllEmployee();
            Assert.AreEqual("Jeff Test", EmployeeList[0].FullName);
        }
 public void Append_SelectAll_Employee_UnitTest()
 {
     Database database = new Database();
     Employee employee1 = new Employee("Bob", "Hope", "E1001", "Milwaukee");
     Employee employee2 = new Employee("Joe", "Schmoe", "E1002", "Waukesha");
     database.Append(employee1);
     database.Append(employee2);
     List<Employee> EmployeeList = database.SelectAllEmployee();
     Assert.AreSame(EmployeeList[0], employee1);
     Assert.AreSame(EmployeeList[1], employee2);
     Assert.AreEqual(EmployeeList[0].EmployeeID, "E1001");
 }
        public void TestEmployeeDateType()
        {
            Database database = new Database();
            Employee employee1 = new Employee("Jeff", "Test", "EIO987", "Brookfield");

            database.Append(employee1);

            DateTime today = DateTime.Today;

            List<Employee> EmployeeList = database.SelectAllEmployee();
            Assert.IsInstanceOfType(EmployeeList[0].DateStarted, typeof(DateTime));
        }
        public void TestEmployeeDateToday()
        {
            Database database = new Database();
            Employee employee1 = new Employee("Jeff", "Test", "EIO987", "Brookfield");

            database.Append(employee1);

            DateTime today = DateTime.Today;

            List<Employee> EmployeeList = database.SelectAllEmployee();
            Assert.AreEqual(today, EmployeeList[0].DateStarted);
        }
Example #5
0
        public void generateInitialEmployees()
        {
            Employee employee1 = new Employee("Joe", "Schmoe", "E001","Milwaukee");
            Employee employee2 = new Employee("Joe", "Smith", "E002", "Milwaukee");
            Employee employee3 = new Employee("Jill", "Johnson", "E003", "Waukesha");
            Employee employee4 = new Employee("Bob", "Hope", "E004", "Milwaukee");
            Employee employee5 = new Employee("Jane", "Hope", "E005", "Brookfield");

            listEmployee.Add(employee1);
            listEmployee.Add(employee2);
            listEmployee.Add(employee3);
            listEmployee.Add(employee4);
            listEmployee.Add(employee5);
        }
Example #6
0
 public bool AddEmployee(string fName, string lName, string ID, string location, string position, float payrate, DateTime dateStarted)
 {
     if (fName != "" & fName != null &
         lName != "" & lName != null &
         ID != "" & ID != null &
         location != "" & location != null &
         position != "" & position != null &
         dateStarted != null)
     {
         Employee employee = new Employee(fName, lName, ID, location);
         employee.Position = position;
         employee.Payrate = payrate;
         employee.DateStarted = dateStarted;
         this.database.Append(employee);
         return true;
     }
     else
     { return false; }
 }
Example #7
0
 public void Append(Employee entry)
 {
     listEmployee.Add(entry);
 }
Example #8
0
 public void Remove(Employee entry)
 {
     listEmployee.Remove(entry);
 }