- added unit tests for Enigma2 and Grundig loaders

- added round-trip unit test for all loaders to check reordering channels and favorites, saving and reloading
- internal code clean-up regarding different favorite list modes (none vs. flags vs. ordered per source vs. mixed source)
This commit is contained in:
Horst Beham
2021-03-14 22:13:22 +01:00
parent f5010439cb
commit 5705a435b4
104 changed files with 19262 additions and 316 deletions

View File

@@ -21,6 +21,9 @@ namespace ChanSort.Api
public class SupportedFeatures
{
private FavoritesMode favoritesMode;
private int maxFavoriteLists = 4;
public ChannelNameEditMode ChannelNameEdit { get; set; }
public bool CleanUpChannelData { get; set; }
public bool DeviceSettings { get; set; }
@@ -33,9 +36,31 @@ namespace ChanSort.Api
public bool CanSaveAs { get; set; } = true;
public Favorites SupportedFavorites { get; set; } = Favorites.A | Favorites.B | Favorites.C | Favorites.D;
public bool SortedFavorites { get; set; }
public bool MixedSourceFavorites { get; set; }
public FavoritesMode FavoritesMode
{
get => this.favoritesMode;
set
{
this.favoritesMode = value;
if (value == FavoritesMode.None)
this.MaxFavoriteLists = 0;
}
}
public int MaxFavoriteLists
{
get => this.maxFavoriteLists;
set
{
if (value == this.maxFavoriteLists)
return;
this.maxFavoriteLists = value;
this.SupportedFavorites = 0;
for (int i = 0; i < value; i++)
this.SupportedFavorites = (Favorites) (((ulong) this.SupportedFavorites << 1) | 1);
}
}
public Favorites SupportedFavorites { get; private set; } = Favorites.A | Favorites.B | Favorites.C | Favorites.D;
public bool AllowGapsInFavNumbers { get; set; }
public bool CanEditFavListNames { get; set; }