mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
core: rearrange test classes (#10023)
This commit is contained in:
72
src/Jackett.Test/TestHelpers/TestWebIndexer.cs
Normal file
72
src/Jackett.Test/TestHelpers/TestWebIndexer.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Jackett.Common.Indexers;
|
||||
using Jackett.Common.Models;
|
||||
using Jackett.Common.Models.IndexerConfig;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Jackett.Test.TestHelpers
|
||||
{
|
||||
public class TestWebIndexer: BaseWebIndexer
|
||||
{
|
||||
public TestWebIndexer():
|
||||
base(id: "test_id",
|
||||
name: "test_name",
|
||||
description: "test_description",
|
||||
link: "https://test.link/",
|
||||
caps: new TorznabCapabilities(),
|
||||
client: null,
|
||||
configService: null,
|
||||
logger: null,
|
||||
configData: new ConfigurationData(),
|
||||
p: null)
|
||||
{
|
||||
Encoding = Encoding.UTF8;
|
||||
Language = "en-us";
|
||||
Type = "private";
|
||||
}
|
||||
|
||||
public override string[] AlternativeSiteLinks { get; protected set; } = {
|
||||
"https://test.link/",
|
||||
"https://alternative-test.link/"
|
||||
};
|
||||
|
||||
public override string[] LegacySiteLinks { get; protected set; } = {
|
||||
"https://legacy-test.link/"
|
||||
};
|
||||
|
||||
public override Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson) =>
|
||||
throw new NotImplementedException();
|
||||
protected override Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query) =>
|
||||
throw new NotImplementedException();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// public methods to test private methods
|
||||
public void _AddCategoryMapping(string trackerCategory, TorznabCategory newznabCategory, string trackerCategoryDesc = null) =>
|
||||
AddCategoryMapping(trackerCategory, newznabCategory, trackerCategoryDesc);
|
||||
|
||||
public void _AddCategoryMapping(int trackerCategory, TorznabCategory newznabCategory, string trackerCategoryDesc = null) =>
|
||||
AddCategoryMapping(trackerCategory, newznabCategory, trackerCategoryDesc);
|
||||
|
||||
public void _AddMultiCategoryMapping(TorznabCategory newznabCategory, params int[] trackerCategories) =>
|
||||
AddMultiCategoryMapping(newznabCategory, trackerCategories);
|
||||
|
||||
public List<string> _MapTorznabCapsToTrackers(TorznabQuery query, bool mapChildrenCatsToParent = false) =>
|
||||
MapTorznabCapsToTrackers(query, mapChildrenCatsToParent);
|
||||
|
||||
public ICollection<int> _MapTrackerCatToNewznab(string input) =>
|
||||
MapTrackerCatToNewznab(input);
|
||||
|
||||
public ICollection<int> _MapTrackerCatDescToNewznab(string input) =>
|
||||
MapTrackerCatDescToNewznab(input);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// public methods to load sample datasets
|
||||
public void AddTestCategories()
|
||||
{
|
||||
TestCategories.AddTestCategories(TorznabCaps.Categories);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user