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.
49 lines
1.5 KiB
49 lines
1.5 KiB
using Models;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Tests
|
|
{
|
|
public class ChampionTests
|
|
{
|
|
[Fact]
|
|
public void Champion_ConstructorWithAbilities_SetsProperties()
|
|
{
|
|
// Arrange
|
|
string name = "Champion 1";
|
|
string titre = "Titre du champion";
|
|
string image = "image1.png";
|
|
var abilities = new List<Ability>()
|
|
{
|
|
new Ability("Capacité 1", "image1.png", "Description de la capacité 1"),
|
|
new Ability("Capacité 2", "image2.png", "Description de la capacité 2")
|
|
};
|
|
|
|
// Act
|
|
var champion = new Champion(name, titre, image, abilities);
|
|
|
|
// Assert
|
|
Assert.Equal(name, champion.Name);
|
|
Assert.Equal(titre, champion.Titre);
|
|
Assert.Equal(image, champion.Image);
|
|
Assert.Equal(abilities, champion.Abilities);
|
|
}
|
|
|
|
[Fact]
|
|
public void Champion_ConstructorWithoutAbilities_SetsProperties()
|
|
{
|
|
// Arrange
|
|
string name = "Champion 2";
|
|
string titre = "Titre du champion";
|
|
string image = "image2.png";
|
|
|
|
// Act
|
|
var champion = new Champion(name, titre, image);
|
|
|
|
// Assert
|
|
Assert.Equal(name, champion.Name);
|
|
Assert.Equal(titre, champion.Titre);
|
|
Assert.Equal(image, champion.Image);
|
|
Assert.Empty(champion.Abilities);
|
|
}
|
|
}
|
|
} |