コード例 #1
0
        public void AddNormalTest()
        {
            EmployeeContainer ec = new EmployeeContainer("test", "AddNormalTestLog");
            ParttimeEmployee pe = new ParttimeEmployee(
                new DateTime(1999, 12, 31),
                new DateTime(2000, 1, 1),
                10,
                "Testy",
                "Peoper",
                new DateTime(1950, 1, 1),
                "111222333"
            );

            Assert.AreEqual(ec.Add(pe), true);
        }
コード例 #2
0
        public void AddExceptionTest()
        {
            EmployeeContainer ec = new EmployeeContainer("test", "AddExceptionTestLog");
            ParttimeEmployee pe = new ParttimeEmployee(
                new DateTime(1999, 12, 31),
                new DateTime(2000, 1, 1),
                10,
                "Testy",
                "Peoper",
                new DateTime(1900, 1, 1), //invalid date of birth
                "111222333"
            );

            Assert.AreEqual(ec.Add(pe), false);
        }
コード例 #3
0
        public void DetailsAtExceptionTest()
        {
            EmployeeContainer ec = new EmployeeContainer("test", "DetailsAtExceptionTestLog");

            ec.DetailsAt(-1);
        }
コード例 #4
0
        public void ModifyNormalTest()
        {
            EmployeeContainer ec = new EmployeeContainer("test", "ModifyNormalTestLog");
            ParttimeEmployee pe = new ParttimeEmployee(
                new DateTime(1999, 12, 31),
                new DateTime(2000, 1, 1),
                10,
                "Testy",
                "Peoper",
                new DateTime(1950, 1, 1),
                "111222333"
            );

            ec.Add(pe);

            FulltimeEmployee fe = new FulltimeEmployee(
                new DateTime(2004, 3, 6),
                new DateTime(2010, 1, 17),
                1000,
                "Dirty",
                "Dan",
                new DateTime(1975, 5, 30),
                "333222111"
            );

            Assert.AreEqual(ec.Modify(0, fe), true);
        }
コード例 #5
0
        public void GetCopyAtNormalTest()
        {
            EmployeeContainer ec = new EmployeeContainer("test", "GetCopyAtNormalTestLog");
            ParttimeEmployee pe = new ParttimeEmployee(
                new DateTime(1999, 12, 31),
                new DateTime(2000, 1, 1),
                10,
                "Testy",
                "Peoper",
                new DateTime(1950, 1, 1),
                "111222333"
            );

            ec.Add(pe);
            Employee peCopy = ec.GetCopyAt(0);

            Assert.AreEqual(peCopy.Details(), pe.Details());
        }
コード例 #6
0
        public void GetCopyAtExceptionTest()
        {
            EmployeeContainer ec = new EmployeeContainer("test", "GetCopyAtExceptionTesLog");

            ec.GetCopyAt(-1);
        }
コード例 #7
0
ファイル: UIMenu.cs プロジェクト: adam-currie/SET-SQ1-EMS
 /**
  * @fn  public UIMenu(string dbFilePath)
  *
  * @brief   Constructor.
  *
  * @param   dbFilePath  Full pathname of the database file.
  */
 public UIMenu(string dbFilePath)
 {
     employees = new EmployeeContainer(dbFilePath, "EMSLogger");
 }