Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleinrotti committed Oct 11, 2024
1 parent 72467c9 commit 3996e08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
11 changes: 7 additions & 4 deletions src/AuthenticodeExaminer.Tests/AuthenticodeExaminer.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../../src/AuthenticodeExaminer/AuthenticodeExaminer.csproj" />
Expand Down
10 changes: 5 additions & 5 deletions src/Signer.Tests/SigningTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public SigningTest()
[InlineData(Hash.SHA256, "SHA256")]
[InlineData(Hash.SHA384, "SHA384")]
[InlineData(Hash.SHA512, "SHA512")]
public async void SignWithStoreHashTest(Hash hash, string expectedHash)
public async Task SignWithStoreHashTest(Hash hash, string expectedHash)
{
var fileList = new List<FileObject>() { await Helpers.ScanFile(_currentDir + "\\test_signed_file.ps1") };
Assert.NotEmpty(fileList);
var result = await Helpers.SignWithStore("49167e096028b922f326d5c098a19d914cf5d8f0", fileList, null, new ParallelOptions(), true, hash);
var result = await Helpers.SignWithStore("7174e534f146c1e21a2d2171fca803511c9a0481", fileList, null, new ParallelOptions(), true, hash);
Assert.Equal(new Tuple<int, int, int>(1, 0, 0), result);

var file = await Helpers.ScanFile(_currentDir + "\\test_signed_file.ps1");
Expand All @@ -38,7 +38,7 @@ public async void SignWithStoreHashTest(Hash hash, string expectedHash)
[InlineData(Hash.SHA256, "SHA256")]
[InlineData(Hash.SHA384, "SHA384")]
[InlineData(Hash.SHA512, "SHA512")]
public async void SignWithFileHashTest(Hash hash, string expectedHash)
public async Task SignWithFileHashTest(Hash hash, string expectedHash)
{
var fileList = await GetFile();
var result = await Helpers.SignWithFile(_currentDir + "\\Signer_TemporaryKey.pfx", "12345", fileList, null, new ParallelOptions(), true, hash);
Expand All @@ -52,7 +52,7 @@ public async void SignWithFileHashTest(Hash hash, string expectedHash)
[InlineData(TimestampHash.SHA256, "SHA256")]
[InlineData(TimestampHash.SHA384, "SHA384")]
[InlineData(TimestampHash.SHA512, "SHA512")]
public async void SignWithTimestampHashTest(TimestampHash timestampHash, string expectedHash)
public async Task SignWithTimestampHashTest(TimestampHash timestampHash, string expectedHash)
{
var fileList = await GetFile();
var result = await Helpers.SignWithFile(_currentDir + "\\Signer_TemporaryKey.pfx", "12345", fileList, null, new ParallelOptions(), true, Hash.SHA256, timestampHash);
Expand All @@ -65,7 +65,7 @@ public async void SignWithTimestampHashTest(TimestampHash timestampHash, string
[Theory]
[InlineData(TimestampType.Authenticode, SignatureKind.AuthenticodeTimestamp)]
[InlineData(TimestampType.RFC3161, SignatureKind.Rfc3161Timestamp)]
public async void SignWithTimestampTypeTest(TimestampType timestampType, SignatureKind expectedType)
public async Task SignWithTimestampTypeTest(TimestampType timestampType, SignatureKind expectedType)
{
var fileList = await GetFile();
var result = await Helpers.SignWithFile(_currentDir + "\\Signer_TemporaryKey.pfx", "12345", fileList, null, new ParallelOptions(), true, Hash.SHA256, TimestampHash.SHA256, timestampType);
Expand Down

0 comments on commit 3996e08

Please sign in to comment.