public void SetUp()
 {
     _mockCaseStatusGateway = new Mock <ICaseStatusGateway>();
     _mockDatabaseGateway   = new Mock <IDatabaseGateway>();
     _caseStatusesUseCase   = new CaseStatusesUseCase(_mockCaseStatusGateway.Object, _mockDatabaseGateway.Object);
     _request             = CaseStatusHelper.CreateCaseStatusAnswerRequest();
     _lacCaseStatusDomain = CaseStatusHelper.CreateCaseStatus(type: "LAC").ToDomain();
     _worker        = TestHelpers.CreateWorker();
     _lacCaseStatus = TestHelpers.CreateCaseStatus(type: "LAC");
 }
Exemplo n.º 2
0
        public void WhenRequestIsValidReturnsSuccessfulResponse()
        {
            var caseStatusDomain = CaseStatusHelper.CreateCaseStatus().ToDomain();

            _mockCaseStatusesUseCase.Setup(x => x.ExecutePostCaseStatusAnswer(_request)).Returns(caseStatusDomain.ToResponse());

            var response = _caseStatusController.CreateCaseStatusAnswers(_request) as ObjectResult;

            response?.StatusCode.Should().Be(201);
            response?.Value.Should().Be("Successfully created case status answers.");
        }
Exemplo n.º 3
0
 public void SetUp()
 {
     _answers = CaseStatusHelper.CreateCaseStatusRequestAnswers(min: 1, max: 1);
     _mockCaseStatusGateway = new Mock <ICaseStatusGateway>();
     _mockDatabaseGateway   = new Mock <IDatabaseGateway>();
     _caseStatusesUseCase   = new CaseStatusesUseCase(_mockCaseStatusGateway.Object, _mockDatabaseGateway.Object);
     _request            = CaseStatusHelper.CreateCaseStatusAnswerRequest(answers: _answers);
     _cpCaseStatusDomain = CaseStatusHelper.CreateCaseStatus(type: "CP").ToDomain();
     _worker             = TestHelpers.CreateWorker();
     _cpCaseStatus       = TestHelpers.CreateCaseStatus(type: "CP");
 }
        public void WhenRequestIsValidReturnsSuccessfulResponse()
        {
            var caseStatus       = CaseStatusHelper.CreateCaseStatus();
            var caseStatusDomain = caseStatus.ToDomain();
            var request          = CaseStatusHelper.CreateCaseStatusRequest(caseStatus.PersonId);

            _mockCaseStatusesUseCase
            .Setup(x => x.ExecutePost(request))
            .Returns(caseStatusDomain);

            var response = _caseStatusController.CreateCaseStatus(request) as ObjectResult;

            _mockCaseStatusesUseCase.Verify(x => x.ExecutePost(request));
            response?.StatusCode.Should().Be(201);
            response?.Value.Should().Be("Successfully created case status.");
        }
Exemplo n.º 5
0
        public void SetUp()
        {
            _mockDatabaseGateway   = new Mock <IDatabaseGateway>();
            _mockCaseStatusGateway = new Mock <ICaseStatusGateway>();
            _caseStatusesUseCase   = new CaseStatusesUseCase(_mockCaseStatusGateway.Object, _mockDatabaseGateway.Object);

            _request = CaseStatusHelper.CreateCaseStatusRequest();

            _mockDatabaseGateway
            .Setup(x => x.GetPersonByMosaicId(It.IsAny <int>()))
            .Returns(TestHelpers.CreatePerson(_request.PersonId));

            var caseStatus = CaseStatusHelper.CreateCaseStatus().ToDomain();

            _mockCaseStatusGateway
            .Setup(x => x.CreateCaseStatus(It.IsAny <CreateCaseStatusRequest>()))
            .Returns(caseStatus);
        }