From e0228bca0f8cc2133a4efbbc5ed62bf01fda3783 Mon Sep 17 00:00:00 2001 From: StevenWdV Date: Wed, 9 Feb 2022 17:02:20 +0100 Subject: Improve wrapper min sign time tests, add .NET version note --- wrappers/csharp/Discovery.cs | 2 +- wrappers/csharp/EduVpnCommonTests/VerifyTests.cs | 4 ++-- wrappers/csharp/README.md | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'wrappers/csharp') diff --git a/wrappers/csharp/Discovery.cs b/wrappers/csharp/Discovery.cs index da4a6ea..21c979f 100644 --- a/wrappers/csharp/Discovery.cs +++ b/wrappers/csharp/Discovery.cs @@ -22,7 +22,7 @@ namespace EduVpnCommon /// If expectedFileName is not one of the allowed values. /// If signature verification fails. public static void Verify( - ArraySegment signatureFileContent, + ArraySegment signatureFileContent, // Span would be nicer, but is not available in .NET Standard 2.0 ArraySegment signedJson, string expectedFileName, DateTimeOffset minSignTime) diff --git a/wrappers/csharp/EduVpnCommonTests/VerifyTests.cs b/wrappers/csharp/EduVpnCommonTests/VerifyTests.cs index 2d4a565..c41696b 100644 --- a/wrappers/csharp/EduVpnCommonTests/VerifyTests.cs +++ b/wrappers/csharp/EduVpnCommonTests/VerifyTests.cs @@ -24,7 +24,7 @@ namespace EduVpnCommonTests File.ReadAllBytes($"{testDataDir_}/{sigFile}"), File.ReadAllBytes($"{testDataDir_}/{jsonFile}"), expectedFileName, - DateTimeOffset.UnixEpoch); + DateTimeOffset.FromUnixTimeSeconds(10)); [Test] [TestCase("server_list.json.minisig", "server_list.json", "server_list.json")] @@ -67,7 +67,7 @@ namespace EduVpnCommonTests File.ReadAllBytes($"{testDataDir_}/{sigFile}"), File.ReadAllBytes($"{testDataDir_}/{jsonFile}"), expectedFileName, - DateTimeOffset.MaxValue)); + DateTimeOffset.FromUnixTimeSeconds(11))); [Test] [TestCase("other_list.json.minisig", "other_list.json", "other_list.json")] diff --git a/wrappers/csharp/README.md b/wrappers/csharp/README.md index 553b123..1ff1123 100644 --- a/wrappers/csharp/README.md +++ b/wrappers/csharp/README.md @@ -4,7 +4,8 @@ You will need to install the [.NET SDK](https://dotnet.microsoft.com/download), which includes the `dotnet` tool. The wrapper targets .NET Standard 2.0, which means that at least .NET Core 2.0 is required (.NET 5+ is also fine). For the -tests, .NET 5 is required. +tests, .NET 5 is required. (Or change `` in EduVpnCommonTests.csproj to e.g. `net6.0` to use newer +versions.) ## Build & test -- cgit v1.2.3