public CohortAssignedToEmployerEventHandlerTestsFixture()
            {
                _autoFixture = new Fixture();
                _mediator    = new Mock <IMediator>();

                _cohortSummary = _autoFixture.Create <GetCohortSummaryQueryResult>();
                _cohortSummary.ChangeOfPartyRequestId = null;
                _mediator.Setup(x => x.Send(It.IsAny <GetCohortSummaryQuery>(),
                                            It.IsAny <CancellationToken>()))
                .ReturnsAsync(() => _cohortSummary);

                _cohortReference          = _autoFixture.Create <string>();
                _employerEncodedAccountId = _autoFixture.Create <string>();
                _encodingService          = new Mock <IEncodingService>();
                _encodingService.Setup(x => x.Encode(It.Is <long>(id => id == _cohortSummary.CohortId),
                                                     EncodingType.CohortReference)).Returns(_cohortReference);
                _encodingService.Setup(x => x.Encode(It.Is <long>(id => id == _cohortSummary.AccountId),
                                                     EncodingType.AccountId)).Returns(_employerEncodedAccountId);

                _handler = new CohortAssignedToEmployerEventHandler(_mediator.Object, _encodingService.Object);

                _messageHandlerContext = new Mock <IMessageHandlerContext>();
                _pipelineContext       = _messageHandlerContext.As <IPipelineContext>();

                _event = _autoFixture.Create <CohortAssignedToEmployerEvent>();
            }
 public CohortAssignedToEmployerEventHandlerTestsFixture WithAssignmentByParty(Party assigningParty)
 {
     _event = new CohortAssignedToEmployerEvent(_autoFixture.Create <long>(),
                                                _autoFixture.Create <DateTime>(),
                                                assigningParty);
     return(this);
 }
예제 #3
0
        public CohortAssignedToEmployerEventHandlerForLegacyTaskCounterTestsFixture LastAssignedParty(Party party)
        {
            CohortAssignedToEmployerEvent = new CohortAssignedToEmployerEvent(CohortId, DateTime.Now, party);

            return(this);
        }