From f500bf119feb0767735a5d00248f4ab8bd11baab Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Fri, 8 Mar 2019 08:26:32 +0000 Subject: [PATCH] !wip --- .../CustomizationSettingsTests.cs | 31 +++++++++++++++++++ .../Ombi.Settings.Tests.csproj | 19 ++++++++++++ src/Ombi.sln | 9 +++++- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/Ombi.Settings.Tests/CustomizationSettingsTests.cs create mode 100644 src/Ombi.Settings.Tests/Ombi.Settings.Tests.csproj diff --git a/src/Ombi.Settings.Tests/CustomizationSettingsTests.cs b/src/Ombi.Settings.Tests/CustomizationSettingsTests.cs new file mode 100644 index 000000000..6d83b99d9 --- /dev/null +++ b/src/Ombi.Settings.Tests/CustomizationSettingsTests.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using Ombi.Settings.Settings.Models; +using System.Collections.Generic; + +namespace Tests +{ + [TestFixture] + public class CustomizationSettingsTests + { + + [TestCaseSource(nameof(TestData))] + public string AddToUrlTests(string applicationUrl, string append) + { + var c = new CustomizationSettings + { + ApplicationUrl = applicationUrl + }; + c.AddToUrl(append); + + return c.ApplicationUrl; + } + + public static IEnumerable TestData + { + get + { + yield return new TestCaseData("https://google.com/", "token?").Returns("https://google.com/token?").SetName("ForwardSlash_On_AppUrl_NotOn_Append"); + } + } + } +} \ No newline at end of file diff --git a/src/Ombi.Settings.Tests/Ombi.Settings.Tests.csproj b/src/Ombi.Settings.Tests/Ombi.Settings.Tests.csproj new file mode 100644 index 000000000..db214be34 --- /dev/null +++ b/src/Ombi.Settings.Tests/Ombi.Settings.Tests.csproj @@ -0,0 +1,19 @@ + + + + netcoreapp2.2 + + false + + + + + + + + + + + + + diff --git a/src/Ombi.sln b/src/Ombi.sln index 2b9be2c42..26c88d4b5 100644 --- a/src/Ombi.sln +++ b/src/Ombi.sln @@ -96,7 +96,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Notifications", "O EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.Lidarr", "Ombi.Api.Lidarr\Ombi.Api.Lidarr.csproj", "{4FA21A20-92F4-462C-B929-2C517A88CC56}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ombi.Helpers.Tests", "Ombi.Helpers.Tests\Ombi.Helpers.Tests.csproj", "{CC8CEFCD-0CB6-45BB-845F-508BCAB5BDC3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Helpers.Tests", "Ombi.Helpers.Tests\Ombi.Helpers.Tests.csproj", "{CC8CEFCD-0CB6-45BB-845F-508BCAB5BDC3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ombi.Settings.Tests", "Ombi.Settings.Tests\Ombi.Settings.Tests.csproj", "{F3969B69-3B07-4884-A7AB-0BAB8B84DF94}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -256,6 +258,10 @@ Global {CC8CEFCD-0CB6-45BB-845F-508BCAB5BDC3}.Debug|Any CPU.Build.0 = Debug|Any CPU {CC8CEFCD-0CB6-45BB-845F-508BCAB5BDC3}.Release|Any CPU.ActiveCfg = Release|Any CPU {CC8CEFCD-0CB6-45BB-845F-508BCAB5BDC3}.Release|Any CPU.Build.0 = Release|Any CPU + {F3969B69-3B07-4884-A7AB-0BAB8B84DF94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F3969B69-3B07-4884-A7AB-0BAB8B84DF94}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3969B69-3B07-4884-A7AB-0BAB8B84DF94}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F3969B69-3B07-4884-A7AB-0BAB8B84DF94}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -293,6 +299,7 @@ Global {10D1FE9D-9124-42B7-B1E1-CEB99B832618} = {9293CA11-360A-4C20-A674-B9E794431BF5} {4FA21A20-92F4-462C-B929-2C517A88CC56} = {9293CA11-360A-4C20-A674-B9E794431BF5} {CC8CEFCD-0CB6-45BB-845F-508BCAB5BDC3} = {6F42AB98-9196-44C4-B888-D5E409F415A1} + {F3969B69-3B07-4884-A7AB-0BAB8B84DF94} = {6F42AB98-9196-44C4-B888-D5E409F415A1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {192E9BF8-00B4-45E4-BCCC-4C215725C869}