Ejemplo n.º 1
0
        public GET_Employee Post([FromBody] object serializedEployee)
        {
            PostEmployeeService postEmployeeService = new PostEmployeeService(new EmployeeData());
            int id = postEmployeeService.InsertEmployee(serializedEployee);

            return(Get(id));
        }
Ejemplo n.º 2
0
        public void PostEmployeeTestRequiredProperty(object serializedEployee)
        {
            Exception exceptionToTest = null;

            try
            {
                PostEmployeeService em = new PostEmployeeService(new EmployeeServiceMock());
                var result             = em.InsertEmployee(serializedEployee);
            }
            catch (Exception ex)
            {
                exceptionToTest = ex;
            }
            Assert.That(exceptionToTest.Message, Does.Contain("Required property"));
        }
Ejemplo n.º 3
0
        public void PostEmployeeSuccesfully(object serializedEployee)
        {
            Exception exceptionToTest = null;

            try
            {
                PostEmployeeService em = new PostEmployeeService(new EmployeeServiceMock());
                var result             = em.InsertEmployee(serializedEployee);
            }
            catch (Exception ex)
            {
                exceptionToTest = ex;
            }
            Assert.IsNull(exceptionToTest);
        }