refactor: moving telemetry wip
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
namespace StevesBot.Webhook.Tests.Unit;
|
||||
|
||||
public sealed class StevesBotWebhookInstrumentationTests : IDisposable
|
||||
{
|
||||
private readonly StevesBotWebhookInstrumentation _instrumentation = new();
|
||||
|
||||
[Fact]
|
||||
public void SourceName_WhenCalled_ItShouldReturnCorrectName()
|
||||
{
|
||||
_instrumentation.SourceName.Should().Be("StevesBot.Webhook");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SourceVersion_WhenCalled_ItShouldReturnCorrectVersion()
|
||||
{
|
||||
_instrumentation.SourceVersion.Should().Be("0.0.0");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_WhenCalled_ItShouldReturnInstance()
|
||||
{
|
||||
using var result = new StevesBotWebhookInstrumentation();
|
||||
using var expectedSource = new ActivitySource(_instrumentation.SourceName, _instrumentation.SourceVersion);
|
||||
|
||||
result.Source.Should().BeEquivalentTo(expectedSource);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_instrumentation.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
global using System.Collections.Concurrent;
|
||||
global using System.Diagnostics;
|
||||
global using System.Net;
|
||||
global using System.Text;
|
||||
|
||||
@@ -13,6 +14,7 @@ global using RichardSzalay.MockHttp;
|
||||
|
||||
global using StevesBot.Library.Discord.Rest;
|
||||
global using StevesBot.Library.Discord.Rest.Requests;
|
||||
global using StevesBot.Webhook.Telemetry;
|
||||
global using StevesBot.Webhook.YouTube;
|
||||
global using StevesBot.Webhook.YouTube.Data;
|
||||
global using StevesBot.Webhook.YouTube.Handlers;
|
||||
|
||||
Reference in New Issue
Block a user