mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
small tweaks
This commit is contained in:
parent
92266c7a58
commit
bb2e5a4c1c
4 changed files with 60 additions and 1 deletions
|
@ -6,6 +6,11 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Nunit" Version="3.6.1" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.7.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
53
Ombi/Ombi.Helpers.Tests/StringCipherTests.cs
Normal file
53
Ombi/Ombi.Helpers.Tests/StringCipherTests.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
#region Copyright
|
||||
// /************************************************************************
|
||||
// Copyright (c) 2017 Jamie Rees
|
||||
// File: StringCipherTests.cs
|
||||
// Created By: Jamie Rees
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ************************************************************************/
|
||||
#endregion
|
||||
|
||||
using NUnit.Framework;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ombi.Helpers.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class StringCipherTests
|
||||
{
|
||||
[TestCaseSource(nameof(StringData))]
|
||||
public string AddPrefix(string text, string key)
|
||||
{
|
||||
return StringCipher.Encrypt(text, key);
|
||||
}
|
||||
|
||||
private static IEnumerable<TestCaseData> StringData
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return new TestCaseData("password1","key1").Returns("AbcCba").SetName("pascalCase");
|
||||
yield return new TestCaseData("").Returns("").SetName("Empty");
|
||||
yield return new TestCaseData("12DSAda").Returns("12DSAda").SetName("With numbers");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
|
||||
namespace Ombi.Helpers
|
||||
{
|
||||
public class StringCipher
|
||||
public static class StringCipher
|
||||
{
|
||||
/// <summary>
|
||||
/// Decrypts the specified cipher text.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard1.6</TargetFramework>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<!--<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>-->
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue