Skip to content

Commit

Permalink
Fix last commit errors on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seedysoft committed Jun 8, 2024
1 parent 8a4c775 commit eed79f3
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 43 deletions.
21 changes: 14 additions & 7 deletions Seedysoft.Tests.sln
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seedysoft.CoreLib", "src\Co
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seedysoft.CoreLib.Tests", "test\CommonLibs\CoreLib.Tests\Seedysoft.CoreLib.Tests.csproj", "{79021581-4172-41AB-B7F2-D85C204F90AF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seedysoft.UtilsLib.Tests", "test\CommonLibs\UtilsLib.Tests\Seedysoft.UtilsLib.Tests.csproj", "{23B20361-9735-4D82-961B-0D9277F77C5E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seedysoft.PvpcLib.Test", "test\Pvpc\PvpcLib.Test\Seedysoft.PvpcLib.Test.csproj", "{C90DDC88-3D11-4491-A97F-36D4ED9BDED4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seedysoft.InfrastructureLib.Test", "test\CommonLibs\InfrastructureLib.Test\Seedysoft.InfrastructureLib.Test.csproj", "{3D03581D-CA4D-429C-92AC-CBF4B5B6D834}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seedysoft.CryptoLib", "src\CommonLibs\CryptoLib\Seedysoft.CryptoLib.csproj", "{F37B65A4-1DD3-4418-B825-FE577AEB29E0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Seedysoft.CryptoLib.Tests", "test\CommonLibs\CryptoLib.Tests\Seedysoft.CryptoLib.Tests.csproj", "{70B94E3B-AB15-4FD8-99D0-6B7DD632888C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -172,10 +174,6 @@ Global
{79021581-4172-41AB-B7F2-D85C204F90AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79021581-4172-41AB-B7F2-D85C204F90AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79021581-4172-41AB-B7F2-D85C204F90AF}.Release|Any CPU.Build.0 = Release|Any CPU
{23B20361-9735-4D82-961B-0D9277F77C5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23B20361-9735-4D82-961B-0D9277F77C5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23B20361-9735-4D82-961B-0D9277F77C5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23B20361-9735-4D82-961B-0D9277F77C5E}.Release|Any CPU.Build.0 = Release|Any CPU
{C90DDC88-3D11-4491-A97F-36D4ED9BDED4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C90DDC88-3D11-4491-A97F-36D4ED9BDED4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C90DDC88-3D11-4491-A97F-36D4ED9BDED4}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -184,6 +182,14 @@ Global
{3D03581D-CA4D-429C-92AC-CBF4B5B6D834}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D03581D-CA4D-429C-92AC-CBF4B5B6D834}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D03581D-CA4D-429C-92AC-CBF4B5B6D834}.Release|Any CPU.Build.0 = Release|Any CPU
{F37B65A4-1DD3-4418-B825-FE577AEB29E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F37B65A4-1DD3-4418-B825-FE577AEB29E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F37B65A4-1DD3-4418-B825-FE577AEB29E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F37B65A4-1DD3-4418-B825-FE577AEB29E0}.Release|Any CPU.Build.0 = Release|Any CPU
{70B94E3B-AB15-4FD8-99D0-6B7DD632888C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{70B94E3B-AB15-4FD8-99D0-6B7DD632888C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70B94E3B-AB15-4FD8-99D0-6B7DD632888C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70B94E3B-AB15-4FD8-99D0-6B7DD632888C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -212,9 +218,10 @@ Global
{C9D74763-F199-4D59-AFE3-048A21B24161} = {D502505E-CB81-4391-8F4A-C08474E89805}
{D0101826-65C5-4D4E-95A5-CE9D96EDF7F1} = {1B84AE05-2D2A-49BD-A067-883B8FA01D75}
{79021581-4172-41AB-B7F2-D85C204F90AF} = {1B84AE05-2D2A-49BD-A067-883B8FA01D75}
{23B20361-9735-4D82-961B-0D9277F77C5E} = {1B84AE05-2D2A-49BD-A067-883B8FA01D75}
{C90DDC88-3D11-4491-A97F-36D4ED9BDED4} = {D502505E-CB81-4391-8F4A-C08474E89805}
{3D03581D-CA4D-429C-92AC-CBF4B5B6D834} = {1B84AE05-2D2A-49BD-A067-883B8FA01D75}
{F37B65A4-1DD3-4418-B825-FE577AEB29E0} = {1B84AE05-2D2A-49BD-A067-883B8FA01D75}
{70B94E3B-AB15-4FD8-99D0-6B7DD632888C} = {1B84AE05-2D2A-49BD-A067-883B8FA01D75}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {76CD9B0B-E4FA-4E83-9623-2163AE82F180}
Expand Down
33 changes: 33 additions & 0 deletions test/CommonLibs/CryptoLib.Tests/CryptoTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace Seedysoft.CryptoLib.Tests;

public sealed class CryptoTests(CryptoTestsFixture cipherFixture)
: IClassFixture<CryptoTestsFixture>
{
public CryptoTestsFixture CipherFixture { get; } = cipherFixture;

[Fact]
public void EncryptThenDecryptTest()
{
string encryptedBytes = Crypto.EncryptText(CipherFixture.TextToEncrypt, CipherFixture.Key);
System.Diagnostics.Debug.WriteLine(encryptedBytes);

string decryptedText = Crypto.DecryptText(encryptedBytes, CipherFixture.Key);
System.Diagnostics.Debug.WriteLine(decryptedText);

Assert.Equal(CipherFixture.TextToEncrypt, decryptedText);
}
}

public sealed class CryptoTestsFixture
{
public string TextToEncrypt { get; }
public string Key { get; }

public CryptoTestsFixture()
{
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

TextToEncrypt = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam nulla tellus, elementum sit amet nunc.";
Key = System.Security.Cryptography.RandomNumberGenerator.GetString(chars, 32);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\CommonLibs\UtilsLib\Seedysoft.UtilsLib.csproj" />
<ProjectReference Include="..\..\..\src\CommonLibs\CryptoLib\Seedysoft.CryptoLib.csproj" />
</ItemGroup>
</Project>
35 changes: 0 additions & 35 deletions test/CommonLibs/UtilsLib.Tests/Helpers/CryptoHelperTests.cs

This file was deleted.

2 changes: 2 additions & 0 deletions test/Pvpc/PvpcLib.Test/PvpcCronBackgroundServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public PvpcCronBackgroundServiceFixture()
Settings.PvpcSettings pvpcSettings = new()
{
CronExpression = "* * 30 2 *", // At every minute on day-of-month 30 in February.
DataUrlTemplate = @"https://apidatos.ree.es/es/datos/mercados/precios-mercados-tiempo-real?start_date={0:yyyy-MM-dd}T00:00&end_date={0:yyyy-MM-dd}T23:59&time_trunc=hour&geo_limit=peninsular",
PvpcId = "1001",
};

InfrastructureLib.DbContexts.DbCxt dbCxt = GetDbCxt();
Expand Down

0 comments on commit eed79f3

Please sign in to comment.