Exemple #1
0
 public PersonService(
     IConfiguration configuration,
     IHttpWrapper http)
 {
     _config = configuration ?? throw new ArgumentNullException("Config is null");
     _http   = http ?? throw new ArgumentNullException("Http wrapper is null");
 }
Exemple #2
0
        public QuestionsController(IQuestionManager questionManager, IAnswerManager answerManager, IPersonaManager personaManager, IHttpWrapper httpWrapper)
        {
            if (questionManager == null)
            {
                throw new ArgumentNullException(nameof(questionManager));
            }

            if (answerManager == null)
            {
                throw new ArgumentNullException(nameof(answerManager));
            }

            if (personaManager == null)
            {
                throw new ArgumentNullException(nameof(personaManager));
            }

            if (httpWrapper == null)
            {
                throw new ArgumentNullException(nameof(httpWrapper));
            }

            _questionManager = questionManager;
            _answerManager   = answerManager;
            _personaManager  = personaManager;
            _httpWrapper     = httpWrapper;
        }
Exemple #3
0
 public UserService(IPersistenceManager persistenceManager, ILoginForm loginForm, IHttpWrapper httpRequest, IDialogWrapper dialogWrapper)
 {
     _persistenceManager = persistenceManager;
     _loginForm          = loginForm;
     _httpRequest        = httpRequest;
     _dialogWrapper      = dialogWrapper;
 }
 public EventListingData(IHttpWrapper httpWrapper, IAppCache cache, ILogger <EventListingData> logger, IFileSystemWrapper fileSystemWrapper)
 {
     _httpWrapper       = httpWrapper;
     _cache             = cache;
     _logger            = logger;
     _fileSystemWrapper = fileSystemWrapper;
 }
 public HttpSearchPaymentService(ILogger logger, Credential credentials, IHttpWrapper httpWrapper, string url) : base(credentials, url)
 {
     this.Url         = url;
     this.Credentials = credentials;
     this.httpWrapper = httpWrapper;
     this.logger      = logger;
 }
Exemple #6
0
 public ElasticService(IHttpWrapper httpWrapper, string elasticUri, string elasticAuth)
 {
     _elasticUri = new Uri("http://" + elasticUri);
     _httpClient = httpWrapper;
     _httpClient.SetBaseAddress(elasticUri);
     _httpClient.SetBasicAuth(elasticAuth);
 }
 public MoviesRepositoryTests()
 {
     this.httpWrapper      = Substitute.For <IHttpWrapper>();
     this.moviesApiContext = Substitute.For <MoviesApiContext>();
     this.httpWrapper.Get <List <MovieQueryResult> >(Arg.Any <Uri>()).Returns(new List <MovieQueryResult>());
     this.moviesApiContext.Endpoint = "http://localhost/mock";
 }
Exemple #8
0
 public YouTubeChannelVideos(IHttpWrapper httpWrapper, IAppCache cache, ILogger <YouTubeChannelVideos> logger, IFileSystemWrapper fileSystemWrapper, ISecretManager secretManager)
 {
     _httpWrapper       = httpWrapper;
     _cache             = cache;
     _logger            = logger;
     _fileSystemWrapper = fileSystemWrapper;
     _secretManager     = secretManager;
 }
Exemple #9
0
        public void SetUp()
        {
            _subscriptionVasLogic = GetInst <SubscriptionVasLogic> ();
            _httpWrapper          = GetInst <IHttpWrapper> ();
            _spotifyService       = GetInst <SpotifyService> ();

            base.Setup();
        }
Exemple #10
0
 public SkyresponseApi(IHttpWrapper httpRequest, IWebSocketWrapper webSocket, ISoundService soundService, IUserService userService)
 {
     _httpRequest   = httpRequest;
     _webSocket     = webSocket;
     _soundService  = soundService;
     _userService   = userService;
     _alreadyPlayed = new List <string>();
 }
Exemple #11
0
 public JobProcessor(ITagRepository tagRepository,
                     IJobRepository jobRepository,
                     IHttpWrapper httpWrapper,
                     IConfigurationProvider configurationProvider)
 {
     this.tagRepository         = tagRepository;
     this.jobRepository         = jobRepository;
     this.httpWrapper           = httpWrapper;
     this.configurationProvider = configurationProvider;
 }
Exemple #12
0
 public DevicesService(AuthenticationToken authenticationToken, IHttpWrapper httpWrapper)
 {
     if (authenticationToken == null)
     {
         throw new ArgumentNullException("authenticationToken");
     }
     if (httpWrapper == null)
     {
         throw new ArgumentNullException("httpWrapper");
     }
     _authenticationToken = authenticationToken;
     _httpWrapper         = httpWrapper;
 }
        public void Setup()
        {
            var moqConfig = new Mock <IConfiguration>();

            moqConfig.Setup(config => config.Get(It.Is <string>(val => val == "peopleService")))
            .Returns(_personServiceUrl);
            _configuration = moqConfig.Object;

            var moqHttp = new Mock <IHttpWrapper>();

            moqHttp.Setup(http => http.GetStringAsync(It.Is <string>(val => val == _personServiceUrl)))
            .Returns(Task.FromResult(testData));
            _http = moqHttp.Object;
        }
Exemple #14
0
        protected T CreateTestControllerWith <T>(
            SubscriptionVasLogic subscriptionVasLogic = null,
            IHttpWrapper httpWrapper      = null,
            SpotifyService spotifyService = null) where T : ApiController, new()
        {
            subscriptionVasLogic = useOrDefault <SubscriptionVasLogic>(subscriptionVasLogic, _subscriptionVasLogic);
            httpWrapper          = useOrDefault <IHttpWrapper>(httpWrapper, _httpWrapper);
            spotifyService       = useOrDefault <SpotifyService>(spotifyService, _spotifyService);

            return(new SpotifyController(
                       subscriptionVasLogic,
                       httpWrapper,
                       spotifyService
                       ) as T);
        }
 public TestContextBuilder(
     IFileSystemWrapper fileSystem,
     IReferenceProcessor referenceProcessor,
     IHttpWrapper httpWrapper,
     IFileProbe fileProbe,
     ICoverageEngineFactory coverageEngineFactory,
     IEnumerable <IFrameworkDefinition> frameworkDefinitions,
     IChutzpahTestSettingsService settingsService)
 {
     this.referenceProcessor    = referenceProcessor;
     this.httpClient            = httpWrapper;
     this.fileSystem            = fileSystem;
     this.fileProbe             = fileProbe;
     this.frameworkDefinitions  = frameworkDefinitions;
     this.settingsService       = settingsService;
     this.coverageEngineFactory = coverageEngineFactory;
 }
 public TestContextBuilder(
     IFileSystemWrapper fileSystem,
     IReferenceProcessor referenceProcessor,
     IHttpWrapper httpWrapper,
     IFileProbe fileProbe,
     ICoverageEngineFactory coverageEngineFactory,
     IEnumerable<IFrameworkDefinition> frameworkDefinitions,
     IChutzpahTestSettingsService settingsService)
 {
     this.referenceProcessor = referenceProcessor;
     this.httpClient = httpWrapper;
     this.fileSystem = fileSystem;
     this.fileProbe = fileProbe;
     this.frameworkDefinitions = frameworkDefinitions;
     this.settingsService = settingsService;
     this.coverageEngineFactory = coverageEngineFactory;
 }
        public void SetUp()
        {
            _httpClient = Substitute.For <IHttpWrapper>();
            _httpClient
            .GetAsync("http://health0/health")
            .Returns(CreateFakeResponse(HttpStatusCode.OK, SuccessfulContent));

            _httpClient
            .GetAsync("http://health1/health")
            .Returns(CreateFakeResponse(HttpStatusCode.InternalServerError, EmptyContent));

            _locationServices = new Dictionary <string, string>
            {
                { "health0", "health0" },
                { "health1", "health1" }
            };
        }
        public void SetUp()
        {
            var successfulResponse = new HttpResponseMessage()
            {
                Content      = new StringContent("success"),
                ReasonPhrase = "reasonPhrase",
                StatusCode   = HttpStatusCode.OK
            };

            _httpWrapper = Substitute.For <IHttpWrapper>();
            _httpWrapper.SendAsync(Arg.Any <HttpRequestMessage>()).Returns(successfulResponse);

            _pingResults = new Dictionary <string, int>
            {
                { "health0", 1 },
                { "health1", 1 },
                { "health2", 1 },
                { "health3", 0 }
            };
        }
 public TestContextBuilder(
     IReferenceProcessor referenceProcessor,
     IFileSystemWrapper fileSystem,
     IHttpWrapper httpWrapper,
     IFileProbe fileProbe,
     IHasher hasher,
     ICoverageEngine coverageEngine,
     IJsonSerializer serializer,
     IEnumerable<IFrameworkDefinition> frameworkDefinitions,
     IEnumerable<IFileGenerator> fileGenerators)
 {
     this.referenceProcessor = referenceProcessor;
     this.httpClient = httpWrapper;
     this.fileSystem = fileSystem;
     this.fileProbe = fileProbe;
     this.hasher = hasher;
     this.serializer = serializer;
     this.frameworkDefinitions = frameworkDefinitions;
     this.fileGenerators = fileGenerators;
     mainCoverageEngine = coverageEngine;
 }
Exemple #20
0
 public DeleteMaker(IHttpWrapper wrapper)
 {
     _wrapper = wrapper;
 }
Exemple #21
0
 public void Setup()
 {
     _wrapper         = A.Fake <IHttpWrapper>();
     _getRequestMaker = new GetRequestMaker(_wrapper);
 }
Exemple #22
0
 public HttpAuthorizationService(Credential credential, IHttpWrapper httpWrapper, string url) : base(credential, url)
 {
     Url              = url;
     Credentials      = credential;
     this.httpWrapper = httpWrapper;
 }
Exemple #23
0
 public GetRequestMaker(IHttpWrapper wrapper)
 {
     _wrapper = wrapper;
 }
 public HttpPaymentService(Credential credential, IHttpWrapper httpWrapper, string url) : base(credential, url)
 {
     this.Credentials = credential;
     this.httpWrapper = httpWrapper;
 }
Exemple #25
0
 public PhotosService(IHttpWrapper <List <Photo> > httpWrapper)
 {
     _httpWrapper = httpWrapper;
 }
 public AccessTokenHelper(GoogleAuthConfiguration config, IHttpWrapper http)
 {
     _config = config;
     _http   = http;
 }
 public AnalyticsDataProvider(string applicationName, IHttpWrapper httpWrapper)
 {
     _applicationName = applicationName;
     _httpWrapper = httpWrapper;
 }
Exemple #28
0
 public RedirectUrlHelper(GoogleAuthConfiguration config, IHttpWrapper http)
 {
     _config = config;
     _http   = http;
 }
Exemple #29
0
 public MoviesRepository(IHttpWrapper httpWrapper, MoviesApiContext moviesApiContext)
 {
     this.httpWrapper      = httpWrapper;
     this.moviesApiContext = moviesApiContext;
 }
Exemple #30
0
 public HealthPingService(IHttpWrapper httpClient, Dictionary<string, string> services)
 {
     _httpClient = httpClient;
     _serviceLocations = services;
 }
Exemple #31
0
 public AnalyticsDataProvider(string applicationName, IHttpWrapper httpWrapper)
 {
     _applicationName = applicationName;
     _httpWrapper     = httpWrapper;
 }
Exemple #32
0
 public APIRequester(IHttpWrapper client)
 {
     this.client = client ?? throw new ArgumentNullException(nameof(client));
 }
Exemple #33
0
 public AlbumsService(IHttpWrapper <List <Album> > httpWrapper, IPhotosService photosService, IMapper <Album, Photo> mapper)
 {
     _httpWrapper   = httpWrapper;
     _photosService = photosService;
     _mapper        = mapper;
 }