Esempio n. 1
0
 public void TestFindAllContact()
 {
     List<Contact> c = new List<Contact>();
     using (ContactDAOImpl daoImp = new ContactDAOImpl())
     {
         c = daoImp.FindAll();
         Assert.IsNotNull(c);
     }
 }
Esempio n. 2
0
        public void TestFindByIdContact()
        {
            using (ContactDAOImpl daoImp = new ContactDAOImpl())
            {

                Contact c = daoImp.FindByID("*****@*****.**");

                Assert.AreEqual(c.ContactID, 2);
            }
        }
Esempio n. 3
0
        public void TestInsertContact()
        {
            Employee e = new Employee()
            {

                EmployeeID = 1,
                Firstname = "Noma",
                Lastname = "Mhlophe",
                PersonnelNum = 3335,
                JobTitle = "IS Operations Manager",
                Position = "Finance Services Manager",
                ExitDate = null,
                HireDate = null,


            };

            using (EmployeeDAOImpl daoImpl = new EmployeeDAOImpl())
            {
                bool isPer = daoImpl.Persist(e);

                Assert.IsTrue(isPer);

            }

            Contact c = new Contact()
            {
                ContactID = 1,
                EmployeeID = e.EmployeeID,
                CellNumber = "0768923715",
                TellphoneNumber = "0219399999",
                Email = "*****@*****.**"

            };

            using (ContactDAOImpl daoImpl = new ContactDAOImpl())
            {
                bool isPer = daoImpl.Persist(c);

                Assert.IsTrue(isPer);

            }
        }
Esempio n. 4
0
        public void TestMergeContact()
        {
            Contact c = new Contact()
            {
                ContactID = 3,
                CellNumber = "0768923745",
                TellphoneNumber = "0219399900",
                Email = "*****@*****.**"

            };

            using (ContactDAOImpl daoImp = new ContactDAOImpl())
            {

                bool isPer = daoImp.Merge(c);

                Assert.IsTrue(isPer);
            }

        }
Esempio n. 5
0
        public void TestPersistContact()
        {
            
            
                Contact c = new Contact()
                {
                    ContactID = 5,
                    CellNumber = "0768992895",
                    TellphoneNumber = "0219399999",
                    Email = "*****@*****.**"

                };
               using (ContactDAOImpl daoImpl = new ContactDAOImpl()){

                    bool isPer = daoImpl.Persist(c);

                    Assert.IsTrue(isPer);
               }
                
            }