public void TestInitialize()
        {
            var configuration = new ConfigurationBuilder()
                                .AddJsonFile("appsettings.json")
                                .Build();

            _flurlClient      = new FlurlClient();
            _serializer       = new FlurlJsonSerializer();
            _endPointParser   = new EndPointParser();
            _appConfiguration = new AppConfiguration(configuration);
        }
Exemple #2
0
        public GitHubService(
            IFlurlClient flurlClient,
            ISerializer serializer,
            IEndPointParser endPointParser,
            IAppConfiguration appConfiguration)
        {
            _endPointParser = endPointParser;
            _flurlClient    = flurlClient;

            _flurlClient.BaseUrl = appConfiguration.GitHubUrl;
            _flurlClient.AllowAnyHttpStatus();
            _flurlClient.WithHeader(Headers.Accept, MimeTypes.ApplicationGitHub);
            _flurlClient.WithHeader(Headers.UserAgent, appConfiguration.GitHubAgent);
            _flurlClient.Settings.JsonSerializer = serializer;
        }