diff --git a/NEW/tests/JdeScoping.Client.Tests/JdeScoping.Client.Tests.csproj b/NEW/tests/JdeScoping.Client.Tests/JdeScoping.Client.Tests.csproj
index a828386..a297514 100644
--- a/NEW/tests/JdeScoping.Client.Tests/JdeScoping.Client.Tests.csproj
+++ b/NEW/tests/JdeScoping.Client.Tests/JdeScoping.Client.Tests.csproj
@@ -11,6 +11,7 @@
+
@@ -22,6 +23,7 @@
+
diff --git a/NEW/tests/JdeScoping.Client.Tests/Placeholder.cs b/NEW/tests/JdeScoping.Client.Tests/Placeholder.cs
deleted file mode 100644
index dd9f57b..0000000
--- a/NEW/tests/JdeScoping.Client.Tests/Placeholder.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-// This file exists to ensure the test project compiles.
-// Add tests here as needed.
-namespace JdeScoping.Client.Tests;
-
-public class Placeholder
-{
- // Tests will be added here
-}
diff --git a/NEW/tests/JdeScoping.Client.Tests/Services/CryptoServiceTests.cs b/NEW/tests/JdeScoping.Client.Tests/Services/CryptoServiceTests.cs
new file mode 100644
index 0000000..b694daf
--- /dev/null
+++ b/NEW/tests/JdeScoping.Client.Tests/Services/CryptoServiceTests.cs
@@ -0,0 +1,142 @@
+using System.Text.Json;
+using JdeScoping.Client.Services;
+using JdeScoping.Core.Models.Auth;
+using Microsoft.JSInterop;
+using NSubstitute;
+using RichardSzalay.MockHttp;
+using Shouldly;
+
+namespace JdeScoping.Client.Tests.Services;
+
+public class CryptoServiceTests
+{
+ [Fact]
+ public async Task EncryptLoginAsync_ReturnsBase64String()
+ {
+ // Arrange
+ var publicKeyPem = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgk...\n-----END PUBLIC KEY-----";
+ var mockHttp = new MockHttpMessageHandler();
+ mockHttp.When("/api/auth/public-key")
+ .Respond("application/json", JsonSerializer.Serialize(new PublicKeyResponse(publicKeyPem)));
+
+ var httpClient = new HttpClient(mockHttp) { BaseAddress = new Uri("http://localhost/") };
+
+ var jsRuntime = Substitute.For();
+ // Mock the JavaScript interop to return a base64 encoded string
+ var expectedBase64 = Convert.ToBase64String(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 });
+ jsRuntime.InvokeAsync("jdeScopingInterop.rsaEncrypt", Arg.Any