Premiere commit - Omika
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using Omika.Core.Observability.Diagnostic;
|
||||
|
||||
namespace Omika.Tests.Observability.Diagnostic;
|
||||
|
||||
public class DiagnosticSessionTests
|
||||
{
|
||||
[Fact]
|
||||
public void SessionId_IsNotEmpty()
|
||||
{
|
||||
Assert.NotEqual(Guid.Empty, new DiagnosticSession().SessionId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SameInstance_SameSessionId()
|
||||
{
|
||||
var session = new DiagnosticSession();
|
||||
|
||||
Assert.Equal(session.SessionId, session.SessionId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NewSession_NewSessionId()
|
||||
{
|
||||
Assert.NotEqual(new DiagnosticSession().SessionId, new DiagnosticSession().SessionId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StartedAtUtc_IsRecent()
|
||||
{
|
||||
DateTimeOffset before = DateTimeOffset.UtcNow.AddSeconds(-2);
|
||||
var session = new DiagnosticSession();
|
||||
|
||||
Assert.InRange(session.StartedAtUtc, before, DateTimeOffset.UtcNow.AddSeconds(2));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user