Exemple #1
0
        public void PutEmployee(int employeeID, object serializedEployee)
        {
            Exception exceptionToTest = null;

            try
            {
                PutEmployeeService em = new PutEmployeeService(new EmployeeServiceMock());
                em.PutEmployee(employeeID, serializedEployee);
            }
            catch (Exception ex)
            {
                exceptionToTest = ex;
            }
            Assert.IsNull(exceptionToTest);
        }
Exemple #2
0
        public void PutEmployeePropertyRequired(int employeeID, object serializedEployee)
        {
            Exception exceptionToTest = null;

            try
            {
                PutEmployeeService em = new PutEmployeeService(new EmployeeServiceMock());
                em.PutEmployee(employeeID, serializedEployee);
            }
            catch (Exception ex)
            {
                exceptionToTest = ex;
            }
            Assert.That(exceptionToTest.Message, Does.Contain("Required property"));
        }
Exemple #3
0
        public void Put(int id, [FromBody] object serializedEployee)
        {
            PutEmployeeService putEmployeeService = new PutEmployeeService(new EmployeeData());

            putEmployeeService.PutEmployee(id, serializedEployee);
        }