Exemple #1
0
        public async void EmployeeDepartmentHistories_Not_Exists()
        {
            var mock = new ServiceMockFacade <IShiftRepository>();

            mock.RepositoryMock.Setup(x => x.EmployeeDepartmentHistories(default(int), It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult <List <EmployeeDepartmentHistory> >(new List <EmployeeDepartmentHistory>()));
            var service = new ShiftService(mock.LoggerMock.Object,
                                           mock.RepositoryMock.Object,
                                           mock.ModelValidatorMockFactory.ShiftModelValidatorMock.Object,
                                           mock.BOLMapperMockFactory.BOLShiftMapperMock,
                                           mock.DALMapperMockFactory.DALShiftMapperMock,
                                           mock.BOLMapperMockFactory.BOLEmployeeDepartmentHistoryMapperMock,
                                           mock.DALMapperMockFactory.DALEmployeeDepartmentHistoryMapperMock);

            List <ApiEmployeeDepartmentHistoryResponseModel> response = await service.EmployeeDepartmentHistories(default(int));

            response.Should().BeEmpty();
            mock.RepositoryMock.Verify(x => x.EmployeeDepartmentHistories(default(int), It.IsAny <int>(), It.IsAny <int>()));
        }