private TestAutocompleteServiceQuery(Uri baseAddress, string queryString)
            {
                var mockConfiguration = new Mock <IAppConfiguration>();

                _responseMessage = GetResponseMessage(new Uri(baseAddress, $"{_autocompletePath}?{queryString?.TrimStart('?')??string.Empty}"), HttpStatusCode.OK);
                var mockIResilientSearchClient = new Mock <IResilientSearchClient>();

                mockIResilientSearchClient.Setup(s => s.GetAsync(_autocompletePath, It.IsAny <string>())).ReturnsAsync(_responseMessage);

                _instance = new AutocompleteServiceQuery(mockConfiguration.Object, mockIResilientSearchClient.Object);
            }
Ejemplo n.º 2
0
            private TestAutocompleteServiceQuery(Uri baseAddress, string queryString)
            {
                var mockConfiguration = new Mock <IAppConfiguration>();

                mockConfiguration.SetupGet(c => c.ServiceDiscoveryUri).Returns(baseAddress);
                mockConfiguration.SetupGet(c => c.AutocompleteServiceResourceType).Returns("SearchAutocompleteService/3.0.0-rc");

                _responseMessage = GetResponseMessage(new Uri(baseAddress, $"{_autocompletePath}?{queryString?.TrimStart('?')??string.Empty}"), HttpStatusCode.OK);
                var mockIResilientSearchClient = new Mock <IResilientSearchClient>();

                mockIResilientSearchClient.Setup(s => s.GetAsync(_autocompletePath, It.IsAny <string>())).ReturnsAsync(_responseMessage);

                var mockTelemetryService = new Mock <IFeatureFlagService>();

                _instance = new AutocompleteServiceQuery(mockConfiguration.Object, mockIResilientSearchClient.Object, mockTelemetryService.Object);
            }