public SearchImportNotificationsHandlerTests() { var applications = GetImportNotifications(); var assessments = GetNotificationAssessments(); var impNotificationContext = new TestImportNotificationContext(); var iwsContext = new TestIwsContext(); var userContext = A.Fake <IUserContext>(); var testMapper = new TestMapper(); testMapper.AddMapper(new SearchResultMap()); impNotificationContext.ImportNotifications.AddRange(applications); impNotificationContext.Importers.AddRange(GetImporters()); impNotificationContext.ImportNotificationAssessments.AddRange(assessments); iwsContext.InternalUsers.AddRange(GetUsers()); A.CallTo(() => userContext.UserId).Returns(new Guid("ac795e26-1563-4833-b8f9-0529eb9e66ae")); importNotificationSearchRepository = new ImportNotificationSearchRepository(iwsContext, impNotificationContext, userContext); handler = new SearchImportNotificationsHandler(importNotificationSearchRepository, testMapper); }
public GetSubmittedMovementsHandlerTests() { SystemTime.Freeze(new DateTime(2015, 1, 1)); var repository = A.Fake<IMovementRepository>(); var movements = new[] { GetMovement(1), GetMovement(2), GetMovement(3), GetMovement(4), GetMovement(5), }; A.CallTo(() => repository.GetMovementsByStatus(NotificationId, MovementStatus.Submitted)) .Returns(movements); var testMapper = new TestMapper(); testMapper.AddMapper(new SubmittedMovementMap()); handler = new GetSubmittedMovementsHandler(repository, testMapper); }
public GetSubmittedMovementsHandlerTests() { SystemTime.Freeze(new DateTime(2015, 1, 1)); var repository = A.Fake <IMovementRepository>(); var movements = new[] { GetMovement(1), GetMovement(2), GetMovement(3), GetMovement(4), GetMovement(5), }; A.CallTo(() => repository.GetMovementsByStatus(NotificationId, MovementStatus.Submitted)) .Returns(movements); var testMapper = new TestMapper(); testMapper.AddMapper(new SubmittedMovementMap()); handler = new GetSubmittedMovementsHandler(repository, testMapper); }