Skip to content

Commit

Permalink
upgrade: remove unnecessary dependencies (#600)
Browse files Browse the repository at this point in the history
* Inline color translation library

* Replace Epoch.net with standard features

* Remove unused Yoh.Text.Json.NamingPolicies dependency

* Revert "Inline color translation library"

This reverts commit 66b32aa.
  • Loading branch information
patrikwlund authored Feb 10, 2025
1 parent d0fde03 commit f4ece67
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Vonage.Test/Common/TimeProviderTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Epoch.net;
using FluentAssertions;
using Xunit;
using TimeProvider = Vonage.Common.TimeProvider;
Expand All @@ -15,7 +14,7 @@ public class TimeProviderTest
[Fact]
public void Epoch_ShouldReturnCurrentEpoch()
{
var reference = EpochTime.Now.Epoch;
var reference = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
var now = new TimeProvider().Epoch;
var delay = now - reference;
delay.Should().BeGreaterOrEqualTo(0).And.BeLessOrEqualTo(100000);
Expand Down
2 changes: 1 addition & 1 deletion Vonage/Common/ITimeProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public interface ITimeProvider
/// <summary>
/// Returns the current epoch value.
/// </summary>
int Epoch { get; }
long Epoch { get; }

/// <summary>
/// Returns the current date and time.
Expand Down
3 changes: 1 addition & 2 deletions Vonage/Common/TimeProvider.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using System;
using Epoch.net;

namespace Vonage.Common;

/// <inheritdoc />
public class TimeProvider : ITimeProvider
{
/// <inheritdoc />
public int Epoch => EpochTime.Now.Epoch;
public long Epoch => DateTimeOffset.UtcNow.ToUnixTimeSeconds();

/// <inheritdoc />
public DateTime UtcNow => DateTime.UtcNow;
Expand Down
2 changes: 0 additions & 2 deletions Vonage/Vonage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
<DelaySign>false</DelaySign>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Epoch.net" Version="4.1.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0"/>
Expand All @@ -73,7 +72,6 @@
<PackageReference Include="System.IO.Abstractions" Version="21.1.7"/>
<PackageReference Include="System.Security.Cryptography.Cng" Version="5.0.0"/>
<PackageReference Include="System.Text.Json" Version="9.0.0"/>
<PackageReference Include="Yoh.Text.Json.NamingPolicies" Version="1.1.2"/>
</ItemGroup>
<ItemGroup>
<None Include="VonageLogo_Symbol_Black.png">
Expand Down

0 comments on commit f4ece67

Please sign in to comment.