public void TestMethod_mStudent_inequality()
        {
            // Students are equal if index ID number is the same.
            masterStudent testUnit1 = new masterStudent("name", "surname", new DateTime(1990, 1, 1), "1111111111111", "111/16781", new DateTime(2016, 1, 1), "ETF Sarajevo");
            masterStudent testUnit2 = new masterStudent("name", "surname", new DateTime(1990, 1, 1), "1111111111111", "111/16782", new DateTime(2016, 1, 1), "ETF Sarajevo");

            Assert.AreNotEqual(testUnit1, testUnit2);
        }
Exemple #2
0
        public void DataDrivenTest_CreatingMasterFromDatabase()
        {
            masterStudent test = new masterStudent(Convert.ToString(TestContext.DataRow["Name"]), Convert.ToString(TestContext.DataRow["Surname"]), Convert.ToDateTime(TestContext.DataRow["DateOfBirth"]), Convert.ToString(TestContext.DataRow["IDNumber"]), Convert.ToString(TestContext.DataRow["IDIndexNumber"]), Convert.ToDateTime(TestContext.DataRow["EndOfPrevEd"]), Convert.ToString(TestContext.DataRow["PlaceOfPrevEd"]));

            Faculty testFax = new Faculty("ETF");

            testFax.AddMasterStudent(Convert.ToString(TestContext.DataRow["Name"]), Convert.ToString(TestContext.DataRow["Surname"]), Convert.ToDateTime(TestContext.DataRow["DateOfBirth"]), Convert.ToString(TestContext.DataRow["IDNumber"]), Convert.ToDateTime(TestContext.DataRow["EndOfPrevEd"]), Convert.ToString(TestContext.DataRow["PlaceOfPrevEd"]));
            Assert.IsTrue(test.IDnumber == testFax.FindStudent(Convert.ToString(TestContext.DataRow["IDNumber"])));
        }
        public void TestMethod_AssigningListOfMasterStudents()
        {
            Faculty testFax = new Faculty("ETF");

            masterStudent        unit1 = new masterStudent("name", "surname", new DateTime(1990, 1, 1), "1111111111111", "100/16781", new DateTime(2005, 1, 1), "ETF Sarajevo");
            masterStudent        unit2 = new masterStudent("name", "surname", new DateTime(1990, 1, 1), "1111111111112", "100/16782", new DateTime(2005, 1, 1), "ETF Sarajevo");
            masterStudent        unit3 = new masterStudent("name", "surname", new DateTime(1990, 1, 1), "1111111111113", "100/16783", new DateTime(2005, 1, 1), "ETF Sarajevo");
            List <masterStudent> input = new List <masterStudent>();

            testFax.ListOfMasterStudents = input;

            /* List of master students cannot be
             * assigned because we don't know if the list
             * is valid for system input
             */
        }
        public void TestMethod_mStudent_Getters()
        {
            masterStudent testUnit = new masterStudent("name", "surname", new DateTime(1990, 1, 1), "1111111111111", "111/16781", new DateTime(2005, 1, 1), "ETF Sarajevo");

            string name = testUnit.Name;

            Assert.AreEqual(name, "name");

            string surname = testUnit.Surname;

            Assert.AreEqual(surname, "surname");

            DateTime birth = testUnit.DateOfBirth;

            Assert.AreEqual(birth, new DateTime(1990, 1, 1));

            string ID = testUnit.IDnumber;

            Assert.AreEqual(ID, "1111111111111");

            string index = testUnit.IndexIDNumber;

            Assert.AreEqual(index, "111/16781");

            DateTime endOfPrevEd = testUnit.EndOfPreviousEducation;

            Assert.AreEqual(endOfPrevEd, new DateTime(2005, 1, 1));

            string placeOfPrevEd = testUnit.PlaceOfPreviousEd;

            Assert.AreEqual(placeOfPrevEd, "ETF Sarajevo");

            List <Course> lista = new List <Course>();

            testUnit.PassedCourses = lista;
            Assert.AreEqual(lista, testUnit.PassedCourses);
        }
 public void TestMethod_mStudent_invalidIndexId_numeric() // Invalid index ID - numeric (must be 13 letters)
 {
     masterStudent testUnit1 = new masterStudent("name", "surname", new DateTime(1990, 1, 1), "1111111111111", "111/16a#1", new DateTime(2016, 1, 1), "ETF Sarajevo");
 }
 public void TestMethod_mStudent_creatingInstance()
 {
     // Parameters: string name, string surname, DateTime dateOfBirth, string IDnumber, string indexIDnumber, DateTime endOfPreviousEducation, string placeOfPreviousEd)
     masterStudent testUnit = new masterStudent("name", "surname", new DateTime(1990, 1, 1), "1111111111111", "111/16781", new DateTime(2005, 1, 1), "ETF Sarajevo");
 }