Exemple #1
0
        public static IConnectedBanksService BuildGetBanksAsyncConnectedBanksServiceMock(PaginatedResponseModel <BankNodeResponse> expectedResponseModel)
        {
            var response = new HttpResponseMessage(HttpStatusCode.OK);

            response.Content = new StringContent(JsonConvert.SerializeObject(expectedResponseModel), Encoding.UTF8, "application/json");

            var requestSenderMock          = new Mock <IHttpRequestSender>();
            IConnectedBanksService service = new ConnectedBanksService(requestSenderMock.Object);

            requestSenderMock
            .Setup(x => x.GetAsync("/banks"))
            .ReturnsAsync(response);

            return(service);
        }
Exemple #2
0
        public static IConnectedBanksService BuildUpdateBankAsyncConnectedBanksServiceMock(BankNodeResponse expectedBank)
        {
            var response = new HttpResponseMessage(HttpStatusCode.OK);

            response.Content = new StringContent(JsonConvert.SerializeObject(expectedBank), Encoding.UTF8, "application/json");

            var requestSenderMock          = new Mock <IHttpRequestSender>();
            IConnectedBanksService service = new ConnectedBanksService(requestSenderMock.Object);

            requestSenderMock
            .Setup(x => x.PatchAsync(It.IsAny <string>(), It.IsAny <StringContent>()))
            .ReturnsAsync(response);

            return(service);
        }