Ejemplo n.º 1
0
        public async void ByStartTimeEndTime_Not_Exists()
        {
            var mock = new ServiceMockFacade <IShiftRepository>();

            mock.RepositoryMock.Setup(x => x.ByStartTimeEndTime(It.IsAny <TimeSpan>(), It.IsAny <TimeSpan>())).Returns(Task.FromResult <Shift>(null));
            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);

            ApiShiftResponseModel response = await service.ByStartTimeEndTime(default(TimeSpan), default(TimeSpan));

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.ByStartTimeEndTime(It.IsAny <TimeSpan>(), It.IsAny <TimeSpan>()));
        }