public void TestRetrieveEmptyEmployeeListShouldThrow()
 {
     using (var client = new RetrieveEmpDetailsClient())
     {
         var empList = client.GetAllEmployeeList();
     }
 }
 public void TestAddRemarkWhenEmployeeNotPresent()
 {
     using (var client = new CreateOrModifyEmployeeClient())
     {
         client.CreateEmployee("sid", "yoyo");
         client.AddRemarksById(6, "watta boy");
         using (var retrieveClient = new RetrieveEmpDetailsClient())
         {
             var empTried = retrieveClient.GetEmployeeDetailsById(6);
             Assert.AreNotEqual(empTried.Remark.Text, "watta boy");
         }
     }
 }
        public void TestAddRemarkByIdForExistingEmployee()
        {
            using (var client = new CreateOrModifyEmployeeClient())
            {
                Employee newEmployee = client.CreateEmployee("sid", "good boy");
                client.AddRemarksById(1, "sad boy");

                using (var retrieveClient = new RetrieveEmpDetailsClient())
                {
                    var empModified = retrieveClient.GetEmployeeDetailsById(1);
                    Assert.AreEqual(empModified.Remark.Text, "sad boy");
                }
            }
        }
        public void TestGetIncorrectEmployeeDetailsByName()
        {
            using (var createClient = new CreateOrModifyEmployeeClient())
            {
                createClient.DisposeEmployeeList();
                createClient.CreateEmployee("baby", "baby doll me sone di ye duniya pittal di");

                using (var client = new RetrieveEmpDetailsClient())
                {
                    string name     = "maharaja";
                    var    employee = client.GetEmployeeDetailsByName(name);
                }
            }
        }
        public void TestGetCorrectEmployeeDetailsByName()
        {
            using (var createClient = new CreateOrModifyEmployeeClient())
            {
                var createEmployee = createClient.CreateEmployee("Rajnikant", "yenna rascala");

                using (var client = new RetrieveEmpDetailsClient())
                {
                    var emp = client.GetEmployeeDetailsByName("Rajnikant");
                    Assert.AreEqual(emp.EmpName, "Rajnikant");
                    Assert.AreEqual(emp.Remark.Text, "yenna rascala");
                }
            }
        }
        public void TestRetrieveEmployeeList()
        {
            using (var createClient = new CreateOrModifyEmployeeClient())
            {
                var emp1 = createClient.CreateEmployee("sid", "watta boy");
                var emp2 = createClient.CreateEmployee("vinayak", "awesome ");
                var emp3 = createClient.CreateEmployee("saif", "smelly cat");

                using (var client = new RetrieveEmpDetailsClient())
                {
                    var employees = client.GetAllEmployeeList();
                    Assert.AreEqual(employees.Length, 3);
                }
            }
        }
        public void TestAddAndRetrieveEmployee()
        {
            using (var createClient = new CreateOrModifyEmployeeClient())
            {
                var emp1 = createClient.CreateEmployee("vinayak", "hello boy");

                using (var retrieveClient = new RetrieveEmpDetailsClient())
                {
                    var emp2 = retrieveClient.GetEmployeeDetailsById(1);

                    Assert.AreEqual(emp1.EmpName, emp2.EmpName);
                    Assert.AreEqual(emp1.Remark.Text, emp2.Remark.Text);
                }
            }
        }
示例#8
0
 public void GetEmployeeDetailsByName(string name)
 {
     try
     {
         using (var client = new RetrieveEmpDetailsClient())
         {
             var emp = client.GetEmployeeDetailsByName(name);
             Console.WriteLine(emp.EmpId);
             Console.WriteLine(emp.EmpName);
             Console.WriteLine(emp.Remark.Text);
             Console.WriteLine(emp.Remark.RemarkTimestamp);
         }
     }
     catch (FaultException <EmployeeDoesNotExists> ex)
     {
         Console.WriteLine(ex.Message);
         Console.WriteLine(ex.Code);
     }
 }
示例#9
0
 public void GetAllEmployeeList()
 {
     try
     {
         using (var client = new RetrieveEmpDetailsClient())
         {
             var empList = client.GetAllEmployeeList();
             foreach (var emp in empList)
             {
                 Console.WriteLine("Employee Id : " + emp.EmpId);
                 Console.WriteLine("Employee Name : " + emp.EmpName);
                 Console.WriteLine("Employee Remarks : " + emp.Remark.Text);
                 Console.WriteLine("Employee Remark TimeStamp : " + emp.Remark.RemarkTimestamp);
             }
         }
     }
     catch (FaultException <EmployeeDoesNotExists> ex)
     {
         Console.WriteLine(ex.Message);
         Console.WriteLine(ex.Code);
     }
 }
        public void TestDeleteExistingEmployeeByName()
        {
            using (var createClient = new CreateOrModifyEmployeeClient())
            {
                createClient.CreateEmployee("sid", "watta boy");
                createClient.CreateEmployee("vinayak", "awesome boy");
                createClient.CreateEmployee("saif", "smelly boy");

                using (var retrieveClient = new RetrieveEmpDetailsClient())
                {
                    var empList = retrieveClient.GetAllEmployeeList();
                    Assert.AreEqual(empList.Length, 3);
                }

                createClient.DeleteEmployeeByName("saif");

                using (var retrieveClient = new RetrieveEmpDetailsClient())
                {
                    var empList = retrieveClient.GetAllEmployeeList();
                    Assert.AreEqual(empList.Length, 2);
                }
            }
        }