public void DisposeEmployeeList()
 {
     using (var client = new CreateOrModifyEmployeeClient())
     {
         client.DisposeEmployeeList();
     }
 }
 public void TestCreateNewEmployee()
 {
     using (var client = new CreateOrModifyEmployeeClient())
     {
         Employee newEmployee = client.CreateEmployee("sid", "good boy");
         Assert.AreEqual(newEmployee.EmpName, "sid");
         Assert.AreEqual(newEmployee.Remark.Text, "good boy");
     }
 }
 public void TestAddNewEmployee()
 {
     using (var client = new CreateOrModifyEmployeeClient())
     {
         var emp = client.CreateEmployee("Rajnikant", "yenna rascala");
         Assert.AreEqual(emp.EmpName, "Rajnikant");
         Assert.AreEqual(emp.Remark.Text, "yenna rascala");
     }
 }
 public void TestDeleteNonExistingEmployeeShouldThrow()
 {
     using (var client = new CreateOrModifyEmployeeClient())
     {
         client.CreateEmployee("sid", "watta boy");
         client.CreateEmployee("vinayak", "shitty boy");
         client.CreateEmployee("saif", "smelly boy");
         client.DeleteEmployeeById(11);
     }
 }
Exemple #5
0
        public void TestCreateNewEmployeeFromDataSource()
        {
            using (var client = new CreateOrModifyEmployeeClient())
            {
                var employeeName   = _testContextInstance.DataRow["EmployeeName"].ToString();
                var employeeRemark = _testContextInstance.DataRow["EmployeeRemark"].ToString();


                Employee newEmployee = client.CreateEmployee(employeeName, employeeRemark);
                Assert.AreEqual(newEmployee.EmpName, "Siddharth");
                Assert.AreEqual(newEmployee.Remark.Text, "Rock n Roll!!");
            }
        }
 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");
         }
     }
 }
Exemple #7
0
 public void DeleteEmployee(string name)
 {
     try
     {
         using (var client = new CreateOrModifyEmployeeClient())
         {
             client.DeleteEmployeeByName(name);
         }
     }
     catch (FaultException <EmployeeDoesNotExists> ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
        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");
                }
            }
        }
Exemple #11
0
 public void AddRemarks(int id, string remarks)
 {
     try
     {
         using (var client = new CreateOrModifyEmployeeClient())
         {
             client.AddRemarksById(id, remarks);
         }
     }
     catch (FaultException <EmployeeDoesNotExists> ex)
     {
         Console.WriteLine(ex.Message);
         Console.WriteLine(ex.Code);
     }
 }
        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);
                }
            }
        }
Exemple #14
0
        public void AddNewEmployee()
        {
            Console.WriteLine("Enter the Employee Name");
            string empName = Console.ReadLine();

            Console.WriteLine("Enter Remarks about the Employee :");
            string empRemarks = Console.ReadLine();

            try
            {
                using (var createOrModifyClient = new CreateOrModifyEmployeeClient())
                {
                    createOrModifyClient.CreateEmployee(empName, empRemarks);
                }
            }
            catch (FaultException <EmployeeAlreadyExistsFault> 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);
                }
            }
        }