Skip to content

Commit

Permalink
Use primary constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Feb 6, 2024
1 parent c6b2f28 commit a4aae4c
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/NGuid.Tests/GuidHelpersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public void CreateV8FromNewArray() =>
#if NET8_0_OR_GREATER
[Fact]
public void CreateV8FromEmptySpan() =>
Assert.Throws<ArgumentException>(() => GuidHelpers.CreateVersion8(stackalloc byte[0]));
Assert.Throws<ArgumentException>(() => GuidHelpers.CreateVersion8([]));

[Fact]
public void CreateV8FromShortSpan() =>
Expand All @@ -180,16 +180,9 @@ public void CreateV8FromName(string algorithmName, string namespaceId, string na
Assert.Equal(new Guid(expected), GuidHelpers.CreateVersion8FromName(new(algorithmName), new(namespaceId), Encoding.ASCII.GetBytes(name)));

#if NET8_0_OR_GREATER
private sealed class FixedTimeProvider : TimeProvider
private sealed class FixedTimeProvider(DateTimeOffset utcNow) : TimeProvider
{
public FixedTimeProvider(DateTimeOffset utcNow)
{
m_utcNow = utcNow;
}

public override DateTimeOffset GetUtcNow() => m_utcNow;

private readonly DateTimeOffset m_utcNow;
public override DateTimeOffset GetUtcNow() => utcNow;
}
#endif
}

0 comments on commit a4aae4c

Please sign in to comment.