public void TryDeleteEmployee() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); var employeeId = Int32.Parse(testContextInstance.DataRow["SecondEmployeeId"].ToString()); var employeeName = testContextInstance.DataRow["SecondEmployeeName"].ToString(); var employeesCountAfterDelete = Int32.Parse(testContextInstance.DataRow["EmployeesCountAfterDelete"].ToString()); using (var employeeManagerClient = new EmployeeManagerClient()) { employeeManagerClient.CreateEmployeeWithRemark(id, name, remark); employeeManagerClient.CreateEmployeeWithRemark(employeeId, employeeName, remark); using (var employeeReaderClient = new EmployeeReaderClient()) { var employees = employeeReaderClient.GetAllEmployees(); employeeManagerClient.DeleteEmployeeById(id); var employeesAfterDelete = employeeReaderClient.GetAllEmployees(); Assert.AreEqual(employeesCountAfterDelete, employeesAfterDelete.Count); } } }
public void TryDeleteAll() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); var employeeId = Int32.Parse(testContextInstance.DataRow["SecondEmployeeId"].ToString()); var employeeName = testContextInstance.DataRow["SecondEmployeeName"].ToString(); var totalEmployees = Int32.Parse(testContextInstance.DataRow["TotalNumberOfEmployees"].ToString()); using (var employeeManagerClient = new EmployeeManagerClient()) { employeeManagerClient.CreateEmployeeWithRemark(id, name, remark); employeeManagerClient.CreateEmployeeWithRemark(employeeId, employeeName, remark); using (var employeeReaderClient = new EmployeeReaderClient()) { var employeeCountBeforeDelete = employeeReaderClient.GetAllEmployees().Count; Assert.AreEqual(totalEmployees, employeeCountBeforeDelete); employeeManagerClient.DeleteEmployees(); employeeReaderClient.GetAllEmployees(); } } }
public void InitEmployeeServiceFixture() { using (var client = new EmployeeManagerClient()) { client.DeleteEmployees(); } }
public void TryDeleteEmployeeByIdWithInvalidIdValue() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); using (var client = new EmployeeManagerClient()) { client.DeleteEmployeeById(id); } }
public void TryCreateEmployeeWithNullNameParameter() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); using (var client = new EmployeeManagerClient()) { client.CreateEmployee(id, null); } }
public void TryAddRemarkWithNullRemarkParameter() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); using (var client = new EmployeeManagerClient()) { client.AddRemark(id, null); } }
public void TryAddRemarkWithInvalidIdValue() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); using (var client = new EmployeeManagerClient()) { client.AddRemark(id, remark); } }
public void TryCreateEmployeeWithInvalidIdValue() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); using (var client = new EmployeeManagerClient()) { client.CreateEmployee(id, name); } }
public void TryCreateEmployeeRemarkWithInvalidRemarkSize() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); using (var client = new EmployeeManagerClient()) { client.CreateEmployeeWithRemark(id, name, remark); } }
private void Form1_Load(object sender, EventArgs e) { EmployeeManagerClient proxy = new EmployeeManagerClient(endPoint); EmployeeDataContract[] data = proxy.SelectAll(); foreach (EmployeeDataContract emp in data) { comboBox1.Items.Add(emp.EmployeeID); } proxy.Close(); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { EmployeeManagerClient proxy = new EmployeeManagerClient(endPoint); EmployeeDataContract data = proxy.SelectByID((int)comboBox1.SelectedItem); textBox1.Text = data.FirstName; textBox2.Text = data.LastName; textBox3.Text = data.HomePhone; textBox4.Text = data.Notes; label6.Text = ""; }
public void TryCreateEmployee() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); using (var client = new EmployeeManagerClient()) { Employee employee = client.CreateEmployee(id, name); Assert.AreEqual(id, employee.Id); } }
private void button1_Click(object sender, EventArgs e) { EmployeeManagerClient proxy = new EmployeeManagerClient(endPoint); EmployeeDataContract data = new EmployeeDataContract(); data.EmployeeID = (int)comboBox1.SelectedItem; data.FirstName = textBox1.Text; data.LastName = textBox2.Text; data.HomePhone = textBox3.Text; data.Notes = textBox4.Text; label6.Text = proxy.Update(data); }
public void TryAddRemarkForNonExistingEmployee() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); var remarkToBeAdded = testContextInstance.DataRow["EmployeeRemark"].ToString(); var employeeIdToAddRemark = Int32.Parse(testContextInstance.DataRow["EmployeeIdToAddRemark"].ToString()); using (var client = new EmployeeManagerClient()) { client.CreateEmployeeWithRemark(id, name, remark); client.AddRemark(employeeIdToAddRemark, remarkToBeAdded); } }
public void TryAddAndRetrieveEmployee() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); using (var employeeManagerClient = new EmployeeManagerClient()) { var employee = employeeManagerClient.CreateEmployeeWithRemark(id, name, remark); using (var employeeReaderClient = new EmployeeReaderClient()) { var employeeReceived = employeeReaderClient.GetEmployeeDetailsById(1); Assert.AreEqual(employee.Id, employeeReceived.Id); } } }
public void TryGetEmployeesByName() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); using (var employeeManagerClient = new EmployeeManagerClient()) { var employee = employeeManagerClient.CreateEmployeeWithRemark(id, name, remark); using (var employeeReaderClient = new EmployeeReaderClient()) { var employeees = employeeReaderClient.GetEmployeesByName(name); Assert.IsTrue(employeees.Any(emp => emp.Id == employee.Id)); } } }
public void TryGetEmployeesByNameForNonExistingEmployee() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); var employeeName = testContextInstance.DataRow["SecondEmployeeName"].ToString(); using (var employeeManagerClient = new EmployeeManagerClient()) { employeeManagerClient.CreateEmployeeWithRemark(id, name, remark); using (var employeeReaderClient = new EmployeeReaderClient()) { employeeReaderClient.GetEmployeesByName(employeeName); } } }
public void TryDeleteNonExistingEmployee() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); var employeeId = Int32.Parse(testContextInstance.DataRow["SecondEmployeeId"].ToString()); var employeeName = testContextInstance.DataRow["SecondEmployeeName"].ToString(); var employeeIdToDelete = Int32.Parse(testContextInstance.DataRow["EmployeeIdToDelete"].ToString()); using (var employeeManagerClient = new EmployeeManagerClient()) { employeeManagerClient.CreateEmployeeWithRemark(id, name, remark); employeeManagerClient.CreateEmployeeWithRemark(employeeId, employeeName, remark); employeeManagerClient.DeleteEmployeeById(employeeIdToDelete); } }
public void TryGetEmployeesWithRemarkForNoResultFound() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var employeeId = Int32.Parse(testContextInstance.DataRow["SecondEmployeeId"].ToString()); var employeeName = testContextInstance.DataRow["SecondEmployeeName"].ToString(); using (var employeeManagerClient = new EmployeeManagerClient()) { employeeManagerClient.CreateEmployee(id, name); employeeManagerClient.CreateEmployee(employeeId, employeeName); using (var employeeReaderClient = new EmployeeReaderClient()) { employeeReaderClient.GetEmployeesWithRemark(); } } }
public void TryAddRemarkForExistingEmployee() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); var remarkToBeAdded = testContextInstance.DataRow["EmployeeRemark"].ToString(); var remarksCount = Int32.Parse(testContextInstance.DataRow["RemarksCount"].ToString()); using (var client = new EmployeeManagerClient()) { Employee employee = client.CreateEmployeeWithRemark(id, name, remark); client.AddRemark(id, remarkToBeAdded); using (var readerClient = new EmployeeReaderClient()) { var employeeWithRemarks = readerClient.GetEmployeeDetailsById(1); Assert.AreEqual(remarksCount, employeeWithRemarks.Remarks.Count); } } }
public void TryGetEmployeesWithRemark() { var id = Int32.Parse(testContextInstance.DataRow["EmployeeId"].ToString()); var name = testContextInstance.DataRow["EmployeeName"].ToString(); var remark = testContextInstance.DataRow["EmployeeRemark"].ToString(); var employeeId = Int32.Parse(testContextInstance.DataRow["SecondEmployeeId"].ToString()); var employeeName = testContextInstance.DataRow["SecondEmployeeName"].ToString(); var employeeCountWithRemark = Int32.Parse(testContextInstance.DataRow["EmployeeCountWithRemark"].ToString()); using (var employeeManagerClient = new EmployeeManagerClient()) { employeeManagerClient.CreateEmployeeWithRemark(id, name, remark); employeeManagerClient.CreateEmployee(employeeId, employeeName); using (var employeeReaderClient = new EmployeeReaderClient()) { Assert.AreEqual(employeeCountWithRemark, employeeReaderClient.GetEmployeesWithRemark().Count); } } }