v1.3.0 Restructure Saxonite workspace and upgrade to .NET 10 (#1)
Move Saxonite’s projects into a dedicated `Workspace` folder and align the solution with .NET 10 and the current Common workspace. Update encryption integration, test project structure and coverage, and repository guidance and upgrade notes. - Relocate application and library projects while retaining Git rename history. - Split tests into Admin, Online, and Shared projects; add representative behavioral and serialization tests. - Update Common integration, application version, and repository documentation. Application version: 1.3.0 Reviewed-on: #1 Co-authored-by: andy <andy@sarand.com>
This commit was merged in pull request #1.
This commit is contained in:
+40
@@ -0,0 +1,40 @@
|
||||
using NUnit.Framework;
|
||||
using Sarand.Net.Standard.Base.Helpers;
|
||||
using Sacs.Web.Components;
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace Saxonite.Net.Core.UnitTests.Web.Base.Controllers
|
||||
{
|
||||
//=======================================================================
|
||||
[TestFixture]
|
||||
public class SaxController_Encryption_Tester
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
[Test]
|
||||
public void Test_ParameterEncryption_RoundTripAndPurposeIsolation()
|
||||
{
|
||||
String key = SacsEncryptionHelper.EncodePlainKey("Saxonite unit test encryption key", SacsEncryptionHelper.KeyLength);
|
||||
NameValueCollection parameters = new NameValueCollection
|
||||
{
|
||||
{ "item", "12345" },
|
||||
{ "caption", "Saxonite café" },
|
||||
};
|
||||
String encrypted = SaController.EncryptParameters(parameters, key, "Saxonite.UnitTests.Parameters");
|
||||
|
||||
NameValueCollection decrypted = SaController.DecryptParameters(encrypted, key, "Saxonite.UnitTests.Parameters");
|
||||
Assert.That(decrypted["item"], Is.EqualTo("12345"));
|
||||
Assert.That(decrypted["caption"], Is.EqualTo("Saxonite café"));
|
||||
|
||||
NameValueCollection wrongPurpose = SaController.DecryptParameters(encrypted, key, "Saxonite.UnitTests.OtherPurpose");
|
||||
Assert.That(wrongPurpose.Count, Is.EqualTo(0));
|
||||
|
||||
String tampered = (encrypted[0] == 'A' ? "B" : "A") + encrypted.Substring(1);
|
||||
NameValueCollection modified = SaController.DecryptParameters(tampered, key, "Saxonite.UnitTests.Parameters");
|
||||
Assert.That(modified.Count, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
Reference in New Issue
Block a user