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 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); } }