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.
46 lines
2.1 KiB
46 lines
2.1 KiB
using Model.Classes;
|
|
using Newtonsoft.Json.Bson;
|
|
using NuGet.Frameworks;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace TestProject1
|
|
{
|
|
public class TestBateau
|
|
{
|
|
[Fact]
|
|
public void Bateau_PremierChapEtPremierEpSuperieurOuEgalAZero_ReturnTrue()
|
|
{
|
|
Bateau test = new Bateau("Sunny", "Sauzando Sani-go", -10, -10, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...");
|
|
bool resultat = (test.PremierChap >= 0 && test.PremierEp >= 0);
|
|
Assert.True(resultat, "Les paramètre PremierChap et PremierEp doivent être supérieur ou égale à 0");
|
|
}
|
|
[Fact]
|
|
public void ConstructeurBateau_ImageEgaleValeurParDefaut_ReturnTrue()
|
|
{
|
|
Bateau test = new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...");
|
|
bool resultat = (test.Image == "baseimage.png");
|
|
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
|
|
}
|
|
[Fact]
|
|
public void ConstructeurBateau2_ImageEgaleValeurParDefaut_ReturnTrue()
|
|
{
|
|
Bateau test = new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...","");
|
|
bool resultat = (test.Image == "baseimage.png");
|
|
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
|
|
}
|
|
[Fact]
|
|
public void SurchargeEqualsBateau_Bateau1EgaleBateau2()
|
|
{
|
|
Bateau bateau1 = new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...", " ");
|
|
Bateau bateau2 = new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...", " ");
|
|
bool resultat =(bateau1.Equals(bateau2));
|
|
Assert.True(resultat, "Les deux bateaux devraient etre égaux car ils onts le meme nom");
|
|
|
|
}
|
|
}
|
|
}
|