Exemple #1
0
        public void CheckLinkedAccountResponseIsRight()
        {
            var crmLinkedAccountResponse = new CrmLinkedAccountResponse
            {
                value = new List <CRMLinkedAccount>()
                {
                    new CRMLinkedAccount
                    {
                        csso_id = "456",
                        hackney_csso_linked_rent_accountid = "12345",
                        rent_account_number = "7890"
                    }
                }
            };

            var linkedAccountResponse = new LinkedAccountResponse
            {
                csso_id = "456",
                hackney_csso_linked_rent_accountid = "12345",
                rent_account_number = "7890"
            };

            var response = CRMFactory.ToLinkedAccountResponse(crmLinkedAccountResponse);

            response.Should().BeEquivalentTo(linkedAccountResponse);
        }
Exemple #2
0
        public async Task GetLinkedAccountWithInvalidRefReturns200AndEmptyList()
        {
            var linkedAccountResponse = new LinkedAccountResponse();
            var cssoId = "456";

            _getLinkedAccountUseCase.Setup(x => x.Execute(cssoId)).ReturnsAsync(linkedAccountResponse);
            var response = (await _classUnderTest.GetLinkedAccount(cssoId).ConfigureAwait(true) as IActionResult) as ObjectResult;

            response.Should().NotBeNull();
            response.StatusCode.Should().Be(200);
            response.Value.Should().BeOfType <List <LinkedAccountResponse> >();
            var listResponse = (List <LinkedAccountResponse>)response.Value;

            listResponse[0].Should().BeEquivalentTo(linkedAccountResponse);
        }
Exemple #3
0
        public async Task GetLinkedAccountAnd200()
        {
            var linkedAccountResponse = new LinkedAccountResponse
            {
                rent_account_number = "123",
                csso_id             = "456",
                hackney_csso_linked_rent_accountid = "789"
            };
            var cssoId = "456";

            _getLinkedAccountUseCase.Setup(x => x.Execute(cssoId)).ReturnsAsync(linkedAccountResponse);
            var response = await _classUnderTest.GetLinkedAccount(cssoId).ConfigureAwait(true) as IActionResult as OkObjectResult;

            response.Should().NotBeNull();
            response.StatusCode.Should().Be(200);
            response.Value.Should().BeOfType <List <LinkedAccountResponse> >();
            var listResponse = (List <LinkedAccountResponse>)response.Value;

            listResponse[0].Should().BeEquivalentTo(linkedAccountResponse);
        }