You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
recyclarr/src/TrashLib.TestLibrary/NewCf.cs

47 lines
1.5 KiB

using Newtonsoft.Json.Linq;
using TrashLib.Services.CustomFormat.Models;
using TrashLib.Services.CustomFormat.Models.Cache;
namespace TrashLib.TestLibrary;
public static class NewCf
{
public static CustomFormatData Data(string name, string trashId, int? score = null)
{
var json = JObject.Parse($"{{'name':'{name}'}}");
return new CustomFormatData("", name, trashId, score, new JObject(json));
}
public static ProcessedCustomFormatData Processed(string name, string trashId, int? score = null)
{
return new ProcessedCustomFormatData(Data(name, trashId, score));
}
public static ProcessedCustomFormatData Processed(string name, string trashId, int? score, JObject json)
{
return new ProcessedCustomFormatData(new CustomFormatData("", name, trashId, score, json));
}
public static ProcessedCustomFormatData Processed(string name, string trashId, JObject json)
{
return Processed(name, trashId, null, json);
}
public static ProcessedCustomFormatData Processed(string name, string trashId, TrashIdMapping cacheEntry)
{
return new ProcessedCustomFormatData(Data(name, trashId))
{
CacheEntry = cacheEntry
};
}
public static ProcessedCustomFormatData Processed(string name, string trashId, JObject json,
TrashIdMapping? cacheEntry)
{
return new ProcessedCustomFormatData(new CustomFormatData("", name, trashId, null, json))
{
CacheEntry = cacheEntry
};
}
}