Skip to content

Commit

Permalink
Feature/50 bump up dotnet 8 (#51)
Browse files Browse the repository at this point in the history
* #50 Bump up dotnet 8

* #50 minor text improvement

* Bump up packages
  • Loading branch information
maythamfahmi committed May 4, 2024
1 parent c926c6f commit 38a21e1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CryptoNet.Cli/CryptoNet.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
2 changes: 1 addition & 1 deletion CryptoNet.Cli/ExampleAes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static void Example_4_Encrypt_Decrypt_Content_With_Human_Readable_Key_Sec
Debug.Assert(ConfidentialDummyData == decrypt);
}

public static void Example_5_Encrypt_And_Decrypt_PdfFile_With_SymmetricKey_Test(string filename)
public static void Example_5_Encrypt_And_Decrypt_File_With_SymmetricKey_Test(string filename)
{
ICryptoNet cryptoNet = new CryptoNetAes();
var key = cryptoNet.ExportKey();
Expand Down
11 changes: 6 additions & 5 deletions CryptoNet.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@
// <date>17-12-2021 12:18:44</date>
// <summary>part of CryptoNet project</summary>

using static System.Runtime.InteropServices.JavaScript.JSType;

namespace CryptoNet.Cli;

internal class Program
{
protected Program() { }

public static void Main()
{
ExampleAes.Example_1_Encrypt_Decrypt_Content_With_SelfGenerated_SymmetricKey();
ExampleAes.Example_2_SelfGenerated_And_Save_SymmetricKey();
ExampleAes.Example_3_Encrypt_Decrypt_Content_With_Own_SymmetricKey();
ExampleAes.Example_4_Encrypt_Decrypt_Content_With_Human_Readable_Key_Secret_SymmetricKey();
ExampleAes.Example_5_Encrypt_And_Decrypt_PdfFile_With_SymmetricKey_Test("TestFiles\\test.docx");
ExampleAes.Example_5_Encrypt_And_Decrypt_PdfFile_With_SymmetricKey_Test("TestFiles\\test.xlsx");
ExampleAes.Example_5_Encrypt_And_Decrypt_PdfFile_With_SymmetricKey_Test("TestFiles\\test.pdf");
ExampleAes.Example_5_Encrypt_And_Decrypt_PdfFile_With_SymmetricKey_Test("TestFiles\\test.png");
ExampleAes.Example_5_Encrypt_And_Decrypt_File_With_SymmetricKey_Test("TestFiles\\test.docx");
ExampleAes.Example_5_Encrypt_And_Decrypt_File_With_SymmetricKey_Test("TestFiles\\test.xlsx");
ExampleAes.Example_5_Encrypt_And_Decrypt_File_With_SymmetricKey_Test("TestFiles\\test.pdf");
ExampleAes.Example_5_Encrypt_And_Decrypt_File_With_SymmetricKey_Test("TestFiles\\test.png");

ExampleRsa.Example_1_Encrypt_Decrypt_Content_With_SelfGenerated_AsymmetricKey();
ExampleRsa.Example_2_SelfGenerated_And_Save_AsymmetricKey();
Expand Down
8 changes: 4 additions & 4 deletions CryptoNet.UnitTests/CryptoNet.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
3 changes: 2 additions & 1 deletion CryptoNet.UnitTests/CryptoNetRsaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using CryptoNet.Models;
using CryptoNet.Utils;
using NUnit.Framework;
using NUnit.Framework.Legacy;
using Shouldly;

// ReSharper disable All
Expand Down Expand Up @@ -116,7 +117,7 @@ public void Encrypt_Decrypt_Documents_With_SelfGenerated_AsymmetricKey_That_Is_S
var decrypt = decryptClient.DecryptToBytes(encrypt);

// assert
Assert.AreEqual(testDocument, decrypt);
ClassicAssert.AreEqual(testDocument, decrypt);
}

[Test]
Expand Down
4 changes: 2 additions & 2 deletions CryptoNet/CryptoNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
<Content Include="CryptoNetLogo-icon.ico">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.3" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 38a21e1

Please sign in to comment.