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); } }
public void TestAddRemarkByNameForExistingEmployee() { using (var client = new CreateOrModifyEmployeeClient()) { Employee newEmployee = client.CreateEmployee("sid", "good boy"); newEmployee = client.CreateEmployee("hitesh", "ma bitch"); client.AddRemarksByName("hitesh", "yoyo boy"); using (var retrieveClient = new RetrieveEmpDetailsClient()) { var empModified = retrieveClient.GetEmployeeDetailsById(2); Assert.AreEqual(empModified.Remark.Text, "yoyo boy"); } } }
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 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 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"); } } }
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); } } }
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 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); } } }
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); } }