public SingleTests()
        {
            _settings = new HoneycombApiSettings
            {
                BatchSize = 1
            };
            _factory = new Mock <IHttpClientFactory>();

            _handler = new MyMessageHandler();

            var client = new HttpClient(_handler);

            _factory.Setup(f => f.CreateClient(It.IsAny <string>()))
            .Returns(client);

            var logger  = new Mock <ILogger <HoneycombService> >();
            var options = new Mock <IOptions <HoneycombApiSettings> >();

            options.Setup(o => o.Value)
            .Returns(_settings);
            _honeycombService = new HoneycombService(_factory.Object, logger.Object, options.Object);
        }
Exemple #2
0
 public static IServiceCollection AddHoneycomb(this IServiceCollection serviceCollection, HoneycombApiSettings honeycombApiSettings)
 {
     serviceCollection.Configure <HoneycombApiSettings>(o => o = honeycombApiSettings);
     return(AddHoneycomb(serviceCollection));
 }