Add InfoTitle's UT
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
dbdd5a6de7
commit
835a7a54b2
@ -0,0 +1,45 @@
|
||||
using Model;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NuGet.Frameworks;
|
||||
|
||||
namespace TestUnitaires
|
||||
{
|
||||
|
||||
public class TU_InfoTitle
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Trajectoire","morceau1.png","Sortie : 2020","Morceau de Népal",Genre.HIP_HOP)]
|
||||
[InlineData(null, "morceau1.png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", null, "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1.png", null, "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1. png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
public void TU_Attributes(string name, string url, string info, string desc, Genre g)
|
||||
{
|
||||
InfoTitle it = new InfoTitle(name, url, info, new Artiste("test"), desc, g);
|
||||
Assert.True(it.Name != null && it.Name.Length < 75);
|
||||
Assert.True(it.ImageURL != null && it.ImageURL.Contains('.'));
|
||||
Assert.False(it.ImageURL.Contains(' '));
|
||||
Assert.True(it.Information != null && it.Information.Length < 500);
|
||||
Assert.True(it.Description != null && it.Description.Length < 500);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Trajectoire", "morceau1.png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData(null, "morceau1.png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", null, "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1.png", null, "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
[InlineData("Trajectoire", "morceau1. png", "Sortie : 2020", "Morceau de Népal", Genre.HIP_HOP)]
|
||||
public void TU_Methods(string name, string url, string info, string desc, Genre g)
|
||||
{
|
||||
InfoTitle it = new InfoTitle(name, url, info, new Artiste("test"), desc, g);
|
||||
Artiste a = new Artiste("Lahuiss");
|
||||
it.AddFeat(a);
|
||||
Assert.Contains(a, it.Feat);
|
||||
it.RemoveFeat(a);
|
||||
Assert.DoesNotContain(a, it.Feat);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue