public void ApiClientTestBaseSetUp()
        {
            _messageHandler = new HttpMessageHandlerStub();

            ClientFactory = Substitute.For <IHttpClientFactory>();

            ClientFactory.CreateClient(Arg.Any <string>())
            .Returns(new HttpClient(_messageHandler)
            {
                BaseAddress = new Uri(HttpStubUri)
            });
        }
Ejemplo n.º 2
0
        public void ApiClientTestBaseSetUp()
        {
            _messageHandler = new HttpMessageHandlerStub();

            ClientFactory = Substitute.For <IHttpClientFactory>();

            ClientFactory.CreateClient(Arg.Any <string>())
            .Returns(new HttpClient(_messageHandler)
            {
                BaseAddress = new Uri(HttpStubUri)
            });

            _bearerToken = NewRandomString();

            BearerTokenProvider = Substitute.For <IBearerTokenProvider>();

            BearerTokenProvider.GetToken()
            .Returns(_bearerToken);
        }