mirror of
https://github.com/Jackett/Jackett.git
synced 2025-12-30 09:39:41 +01:00
Saved password security
This commit is contained in:
30
src/Jackett.Test/Services/ProtectionServiceTests.cs
Normal file
30
src/Jackett.Test/Services/ProtectionServiceTests.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Jackett.Services;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Autofac;
|
||||
|
||||
namespace JackettTest.Services
|
||||
{
|
||||
[TestFixture]
|
||||
class ProtectionServiceTests : TestBase
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void Should_be_able_to_encrypt_and_decrypt()
|
||||
{
|
||||
var ss = TestUtil.Container.Resolve<IServerService>();
|
||||
ss.Config.InstanceId = "12345678";
|
||||
var ps = TestUtil.Container.Resolve<IProtectionService>();
|
||||
var input = "test123";
|
||||
var protectedInput = ps.Protect(input);
|
||||
var output = ps.UnProtect(protectedInput);
|
||||
|
||||
Assert.AreEqual(output, input);
|
||||
Assert.AreNotEqual(input, protectedInput);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user