diff --git a/Ombi/Ombi.Helpers.Tests/Ombi.Helpers.Tests.csproj b/Ombi/Ombi.Helpers.Tests/Ombi.Helpers.Tests.csproj index 3aabbe61a..c8047a6b6 100644 --- a/Ombi/Ombi.Helpers.Tests/Ombi.Helpers.Tests.csproj +++ b/Ombi/Ombi.Helpers.Tests/Ombi.Helpers.Tests.csproj @@ -6,6 +6,11 @@ + + + + + \ No newline at end of file diff --git a/Ombi/Ombi.Helpers.Tests/StringCipherTests.cs b/Ombi/Ombi.Helpers.Tests/StringCipherTests.cs new file mode 100644 index 000000000..5866fbc88 --- /dev/null +++ b/Ombi/Ombi.Helpers.Tests/StringCipherTests.cs @@ -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 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"); + } + } + + } +} \ No newline at end of file diff --git a/Ombi/Ombi.Helpers/StringCipher.cs b/Ombi/Ombi.Helpers/StringCipher.cs index aaa33d289..c8e75c588 100644 --- a/Ombi/Ombi.Helpers/StringCipher.cs +++ b/Ombi/Ombi.Helpers/StringCipher.cs @@ -5,7 +5,7 @@ using System.Text; namespace Ombi.Helpers { - public class StringCipher + public static class StringCipher { /// /// Decrypts the specified cipher text. diff --git a/Ombi/Ombi.TheMovieDbApi/Ombi.TheMovieDbApi.csproj b/Ombi/Ombi.TheMovieDbApi/Ombi.TheMovieDbApi.csproj index 07b575cc8..19b57c95c 100644 --- a/Ombi/Ombi.TheMovieDbApi/Ombi.TheMovieDbApi.csproj +++ b/Ombi/Ombi.TheMovieDbApi/Ombi.TheMovieDbApi.csproj @@ -2,6 +2,7 @@ netstandard1.6 + False