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");
                }
            }
        }
示例#3
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);
     }
 }