public void TestRetrieveEmptyEmployeeListShouldThrow()
 {
     using (var client = new RetrieveEmpDetailsClient())
     {
         var empList = client.GetAllEmployeeList();
     }
 }
        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);
                }
            }
        }
示例#3
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);
                }
            }
        }