Ejemplo n.º 1
0
        public void Arrange()
        {
            _commitmentView        = new CommitmentView();
            _employerCommitmentApi = new Mock <IEmployerCommitmentApi>();
            _employerCommitmentApi.Setup(x => x.GetEmployerCommitment(It.IsAny <long>(), It.IsAny <long>()))
            .ReturnsAsync(_commitmentView);

            _employerCommitmentApi.Setup(x => x.GetTransferSenderCommitment(It.IsAny <long>(), It.IsAny <long>()))
            .ReturnsAsync(_commitmentView);

            _query = new GetCommitmentQueryRequest {
                AccountId = ExpectedAccountId, CommitmentId = ExpectedCommitmentId
            };

            _requestHandler = new GetCommitmentQueryHandler(_employerCommitmentApi.Object);
        }
Ejemplo n.º 2
0
        public void SetUp()
        {
            _mockCommitmentRespository = new Mock <ICommitmentRepository>();
            _handler = new GetCommitmentQueryHandler(_mockCommitmentRespository.Object, new GetCommitmentValidator(), new CommitmentRules());

            Fixture dataFixture = new Fixture();

            _fakeRepositoryCommitment = dataFixture.Build <Commitment>().Create();
            _exampleValidRequest      = new GetCommitmentRequest
            {
                CommitmentId = _fakeRepositoryCommitment.Id,
                Caller       = new Caller
                {
                    CallerType = CallerType.Provider,
                    Id         = _fakeRepositoryCommitment.ProviderId.Value
                }
            };
        }
        public void SetUp()
        {
            _mockCommitmentRespository = new Mock <ICommitmentRepository>();
            _handler = new GetCommitmentQueryHandler(_mockCommitmentRespository.Object, new GetCommitmentValidator(),
                                                     new CommitmentRules());

            var dataFixture = new Fixture();

            _fakeCommitment      = dataFixture.Build <Commitment>().Create();
            _exampleValidRequest = new GetCommitmentRequest
            {
                CommitmentId = _fakeCommitment.Id,
                Caller       = new Caller
                {
                    CallerType = CallerType.TransferSender,
                    Id         = (long)_fakeCommitment?.TransferSenderId.Value
                }
            };
            _mockCommitmentRespository.Setup(x => x.GetCommitmentById(It.IsAny <long>())).ReturnsAsync(_fakeCommitment);
        }