public void Method_Authentication_When_ParameterRequestIsNull_Should_ThrowInvalidCastException()
        {
            _employeeApplicationService = new EmployeeApplicationService(_employeeServiceMock.Object, _unitOfWorkMock.Object);

            Assert.ThrowsExceptionAsync <InvalidCastException>(() =>
                                                               _employeeApplicationService.AuthenticationAsync(null));
        }
        public void Method_Authentication_When_ParameterRequestBarcodeNotFoundInDataBase_Should_ReturnNullAndNotification()
        {
            _employeeServiceMock.Setup(item => item.AuthenticationByUsernameAsync(It.IsAny <Employee>())).Returns((Task <Employee>)null);

            _employeeApplicationService = new EmployeeApplicationService(_employeeServiceMock.Object, _unitOfWorkMock.Object);

            var dynamicRequest = JObject.Parse(RequestBarcode);
            var employeeAuth   = _employeeApplicationService.AuthenticationAsync(dynamicRequest);

            Assert.IsNull(employeeAuth.Result);
            Assert.IsTrue(_employeeApplicationService.ListNotifications().Any());
        }
        public void Method_Authentication_When_ParameterRequestBarcodeIsValid_Should_Return_EmployeeAuthenticated()
        {
            _employeeServiceMock.Setup(item => item.AuthenticationByBarcodeAsync(It.IsAny <Employee>()))
            .Returns(_employeeTask);

            _employeeApplicationService = new EmployeeApplicationService(_employeeServiceMock.Object, _unitOfWorkMock.Object);

            var dynamicRequest = JObject.Parse(RequestBarcode);
            var employeeAuth   = _employeeApplicationService.AuthenticationAsync(dynamicRequest);

            Assert.IsNotNull(employeeAuth);
            Assert.IsTrue(employeeAuth.Result.EmployeeNumber > 0);
            Assert.AreEqual(0, _employeeApplicationService.ListNotifications().Count());
        }
Пример #4
0
 public EmployeeController(IEmployeeApplicationService employeeService)
 {
     _employeeService = employeeService;
 }
Пример #5
0
 public AgendaController(IEmployeeApplicationService employeeApplicationService)
 {
     _employeeApplicationService = employeeApplicationService;
 }
Пример #6
0
 public EmployeesController(TechneAppDbContext context, IEmployeeApplicationService employeeApplicationService)
 {
     _context = context;
     _employeeApplicationService = employeeApplicationService;
 }