Skip to content

Commit

Permalink
Refactored whole project
Browse files Browse the repository at this point in the history
  • Loading branch information
Haik committed Oct 14, 2023
1 parent 7469375 commit 5a7991a
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 46 deletions.
2 changes: 1 addition & 1 deletion Pandatech.Crypto.Tests/Pandatech.Crypto.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\PandatechCrypto\Pandatech.Crypto.csproj" />
<ProjectReference Include="..\Pandatech.Crypto\Pandatech.Crypto.csproj" />
</ItemGroup>

</Project>
11 changes: 7 additions & 4 deletions Pandatech.Crypto.Tests/UnitTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using Pandatech.Cryptos;
using Random = Pandatech.Cryptos.Random;

namespace Pandatech.Crypto.Tests;

public class UnitTests
Expand All @@ -6,16 +9,16 @@ public class UnitTests
public void Generate_ShouldReturnByteArray()
{
const int length = 16;
var randomBytes = Random.GenerateBytes(length);
var randomBytes = Cryptos.Random.GenerateBytes(length);

Assert.NotNull(randomBytes);
Assert.Equal(length, randomBytes.Length);
}

[Theory]
[InlineData(25, true, true, true, true)]
[InlineData(25, false, true, false, false)]
[InlineData(25, true, true, true, false)]
[InlineData(100, true, true, true, true)]
[InlineData(10, false, true, false, false)]
[InlineData(50, true, true, true, false)]
public void Generate_ShouldReturnPasswordWithCorrectProperties(
int length,
bool includeUppercase,
Expand Down
12 changes: 6 additions & 6 deletions Pandatech.Crypto.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34024.191
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pandatech.Crypto", "PandatechCrypto\Pandatech.Crypto.csproj", "{04362C72-3011-466E-81BB-FFBFC94D02C7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pandatech.Crypto.Tests", "Pandatech.Crypto.Tests\Pandatech.Crypto.Tests.csproj", "{89D6535F-549C-4091-BF21-96565F098C3F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pandatech.Crypto", "Pandatech.Crypto\Pandatech.Crypto.csproj", "{97B88123-20B1-4F0A-82E7-DFDD08A03B7C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{04362C72-3011-466E-81BB-FFBFC94D02C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04362C72-3011-466E-81BB-FFBFC94D02C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04362C72-3011-466E-81BB-FFBFC94D02C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04362C72-3011-466E-81BB-FFBFC94D02C7}.Release|Any CPU.Build.0 = Release|Any CPU
{89D6535F-549C-4091-BF21-96565F098C3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89D6535F-549C-4091-BF21-96565F098C3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89D6535F-549C-4091-BF21-96565F098C3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89D6535F-549C-4091-BF21-96565F098C3F}.Release|Any CPU.Build.0 = Release|Any CPU
{97B88123-20B1-4F0A-82E7-DFDD08A03B7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97B88123-20B1-4F0A-82E7-DFDD08A03B7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97B88123-20B1-4F0A-82E7-DFDD08A03B7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97B88123-20B1-4F0A-82E7-DFDD08A03B7C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion PandatechCrypto/Aes256.cs → Pandatech.Crypto/Aes256.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Security.Cryptography;

namespace Pandatech.Crypto;
namespace Pandatech.Cryptos;

public static class Aes256
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Text;
using Konscious.Security.Cryptography;

namespace Pandatech.Crypto;
namespace Pandatech.Cryptos;

public static class Argon2Id
{
Expand Down
2 changes: 1 addition & 1 deletion PandatechCrypto/Random.cs → Pandatech.Crypto/Random.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Security.Cryptography;

namespace Pandatech.Crypto;
namespace Pandatech.Cryptos;

public static class Random
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Security.Cryptography;

namespace Pandatech.Crypto;
namespace Pandatech.Cryptos;

public static class RandomPassword
{
Expand Down
File renamed without changes.
File renamed without changes
31 changes: 0 additions & 31 deletions PandatechCrypto/Pandatech.Crypto.csproj

This file was deleted.

0 comments on commit 5a7991a

Please sign in to comment.