Fix some Critical, Major, Minor and Info issues
continuous-integration/drone/push Build is passing Details

pull/16/head
Corentin LEMAIRE 2 years ago
parent a0da582aec
commit c4c4c645f3

@ -7,8 +7,6 @@ public class InfoTitle : Title
{
public Artist Artist { get; set; }
private Artist artist = new Artist();
public string Description
{
get => description;
@ -38,7 +36,7 @@ public class InfoTitle : Title
public InfoTitle(string name, string imageURL, string information, Artist artist, string description, Genre genre) : base(name,imageURL,information)
{
this.artist = artist;
Artist = artist;
Description = description;
Genre = genre;
}

@ -89,29 +89,11 @@ public class Playlist
private int index = 0;
public bool Shuffle
{
get => shuffle;
set { shuffle = value; }
}
private bool shuffle = false;
public bool Shuffle { get; set; } = false;
public bool Loop
{
get => loop;
set { loop = value; }
}
private bool loop = false;
public bool LoopTitle
{
get => loopTitle;
set { loopTitle = value; }
}
public bool Loop { get; set; } = false;
private bool loopTitle = false;
public bool LoopTitle { get; set; } = false;
private readonly List<int> played = new List<int>();
@ -221,7 +203,7 @@ public class Playlist
return $"Name : {Name}";
}
int RandomGenerator(int n)
static int RandomGenerator(int n)
{
RandomNumberGenerator rng = RandomNumberGenerator.Create();
byte[] randomBytes = new byte[4];

@ -11,7 +11,7 @@ using System.IO;
namespace Model.Serialization;
public class Linq_Xml_Serialization : IDataManager
public class LinqXmlSerialization : IDataManager
{
private static string XMLPATH = Path.Combine(Environment.CurrentDirectory, "Data");
@ -75,7 +75,7 @@ public class Linq_Xml_Serialization : IDataManager
}
}
public Linq_Xml_Serialization()
public LinqXmlSerialization()
{
playlists = new List<Playlist>();
artists = new List<Artist>();
@ -562,7 +562,7 @@ public class Linq_Xml_Serialization : IDataManager
}
}
}
public Genre GetGenreByName(string genre)
public static Genre GetGenreByName(string genre)
{
if (genre == "HIP_HOP") return Genre.HIP_HOP;
if (genre == "POP") return Genre.POP;

@ -60,11 +60,11 @@ public class StubInfoTitle
{
infoTitles.Remove(title);
}
public void AddFeat(InfoTitle infoTitle, Artist artist)
public static void AddFeat(InfoTitle infoTitle, Artist artist)
{
infoTitle.AddFeat(artist);
}
public void RemoveFeat(InfoTitle infoTitle, Artist artist)
public static void RemoveFeat(InfoTitle infoTitle, Artist artist)
{
infoTitle.RemoveFeat(artist);
}

@ -148,12 +148,12 @@ public class StubManager : IDataManager
public void LoadSerialization()
{
// Doesn't do anything because it's Stubs
}
public void SaveSerialization()
{
// Doesn't do anything because it's Stubs
}
public CustomTitle? GetCustomTitleByUrl(string custom)

@ -15,7 +15,7 @@ namespace TestUnitaires
[InlineData("Réference")]
public void TU_Methods(string? test)
{
IDataManager DataManager = new Linq_Xml_Serialization();
IDataManager DataManager = new LinqXmlSerialization();
Playlist p = new Playlist(test, "PlaceHolder", "place.holder");
Album album = new Album(test, "place.holder", new Artist("test"), "PlaceHolder", "PlaceHolder");
CustomTitle t = new CustomTitle(test, "test. mp3", "Banger", "path");

Loading…
Cancel
Save