Skip to content

Commit

Permalink
Merge pull request #272 from mattosaurus/chore/improve-encrypt-tests
Browse files Browse the repository at this point in the history
Improve encrypt tests
  • Loading branch information
mattosaurus authored Jan 18, 2024
2 parents aee754a + 3f12031 commit 729b977
Show file tree
Hide file tree
Showing 14 changed files with 2,643 additions and 741 deletions.
454 changes: 454 additions & 0 deletions PgpCore.Tests/UnitTests/Encrypt/EncryptAsync.File.cs

Large diffs are not rendered by default.

468 changes: 468 additions & 0 deletions PgpCore.Tests/UnitTests/Encrypt/EncryptAsync.Stream.cs

Large diffs are not rendered by default.

387 changes: 387 additions & 0 deletions PgpCore.Tests/UnitTests/Encrypt/EncryptAsync.String.cs

Large diffs are not rendered by default.

454 changes: 454 additions & 0 deletions PgpCore.Tests/UnitTests/Encrypt/EncryptSync.File.cs

Large diffs are not rendered by default.

468 changes: 468 additions & 0 deletions PgpCore.Tests/UnitTests/Encrypt/EncryptSync.Stream.cs

Large diffs are not rendered by default.

387 changes: 387 additions & 0 deletions PgpCore.Tests/UnitTests/Encrypt/EncryptSync.String.cs

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions PgpCore.Tests/UnitTests/GenerateKey/KeyAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@
using Xunit;
using Org.BouncyCastle.Bcpg.OpenPgp;
using System.IO;
using Org.BouncyCastle.Utilities.Zlib;
using System;
using System.Collections.Generic;
using Org.BouncyCastle.Bcpg;
using System.Security.Cryptography.X509Certificates;

namespace PgpCore.Tests.UnitTests.GenerateKey
{
public class KeyAsync
public class KeyAsync : TestBase
{
#if NETFRAMEWORK
public const string VERSION = "Version: BouncyCastle.NET Cryptography (net461) v2.1.1+851feee009";
#else
public const string VERSION = "Version: BouncyCastle.NET Cryptography (net6.0) v2.1.1+851feee009";
#endif

[Fact]
public async Task GenerateKeyAsync_CreatePublicAndPrivateKeys_ShouldCreateKeysWithDefaultProperties()
{
Expand Down
11 changes: 1 addition & 10 deletions PgpCore.Tests/UnitTests/GenerateKey/KeySync.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
using FluentAssertions.Execution;
using FluentAssertions;
using System.Threading.Tasks;
using Xunit;
using Org.BouncyCastle.Bcpg.OpenPgp;
using System.IO;
using Org.BouncyCastle.Utilities.Zlib;
using System;
using System.Collections.Generic;
using Org.BouncyCastle.Bcpg;
using System.Security.Cryptography.X509Certificates;

namespace PgpCore.Tests.UnitTests.GenerateKey
{
public class KeySync
public class KeySync : TestBase
{
#if NETFRAMEWORK
public const string VERSION = "Version: BouncyCastle.NET Cryptography (net461) v2.1.1+851feee009";
#else
public const string VERSION = "Version: BouncyCastle.NET Cryptography (net6.0) v2.1.1+851feee009";
#endif

[Fact]
public void GenerateKey_CreatePublicAndPrivateKeys_ShouldCreateKeysWithDefaultProperties()
{
Expand Down
10 changes: 10 additions & 0 deletions PgpCore.Tests/UnitTests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ namespace PgpCore.Tests.UnitTests
{
public class TestBase
{
#if NETFRAMEWORK
public const string VERSION = "BouncyCastle.NET Cryptography (net461) v2.1.1+851feee009";
#else
public const string VERSION = "BouncyCastle.NET Cryptography (net6.0) v2.1.1+851feee009";
#endif
public const string DEFAULTNAME = "name";
public const string TESTNAME = "Test Name";
public const string TESTHEADERKEY = "Test Header";
public const string TESTHEADERVALUE = "Test Value";

public static IEnumerable<object[]> GetCompressionAlgorithimTags()
{
foreach (CompressionAlgorithmTag compressionAlgorithmTag in TestHelper.GetEnumValues<CompressionAlgorithmTag>())
Expand Down
Loading

0 comments on commit 729b977

Please sign in to comment.