コード例 #1
0
        public async Task DeleteEmployeeAsync_WithEmployeeIdOfZero_ReturnsNull()
        {
            var employeeId = 0;

            var result = await employeeBL.DeleteEmployeeAsync(employeeId);

            Assert.IsNull(result);
        }
コード例 #2
0
        public async Task <IHttpActionResult> Delete(int employeeId)
        {
            var result = await employeeBL.DeleteEmployeeAsync(employeeId);

            if (result != null)
            {
                return(Ok(mapper.Map <EmployeeModel>(result)));
            }

            return(Content(HttpStatusCode.NotFound, AppConstants.HttpErrorMessage.ResourceNotFound));
        }
コード例 #3
0
        public async Task DeleteEmployeeAsync_WithEmployeeIdGreaterThanZero_ReturnsEmployeeDTO()
        {
            MockEmployeeDL
            .Stub(x => x.DeleteEmployeeAsync(Arg <int> .Is.Anything))
            .Return(Task.FromResult(new EmployeeDTO()));

            var employeeId = 1;

            var result = await employeeBL.DeleteEmployeeAsync(employeeId);

            Assert.IsNotNull(result);
        }