예제 #1
0
        public void testCarac()
        {
            Caracteristique carac = new Caracteristique();

            Assert.AreEqual(carac.ToString(), "Default Name 0 (" + EDefCaracteristique.Chance + ")");
            Assert.AreEqual(carac.ID, 0);
            Assert.AreEqual(carac.Nom, "Default Name");
            Assert.AreEqual(carac.Definition, EDefCaracteristique.Chance);
            Assert.AreEqual(carac.Type, ETypeCaracteristique.Jedi);
            Assert.AreEqual(carac.Valeur, 0);

            Caracteristique carac2 = new Caracteristique(1, "Test", EDefCaracteristique.Force, ETypeCaracteristique.Jedi, 42);

            Assert.AreEqual(carac2.ToString(), "Test 42 (" + EDefCaracteristique.Force + ")");
            Assert.AreEqual(carac2.ID, 1);
            Assert.AreEqual(carac2.Nom, "Test");
            Assert.AreEqual(carac2.Definition, EDefCaracteristique.Force);
            Assert.AreEqual(carac2.Type, ETypeCaracteristique.Jedi);
            Assert.AreEqual(carac2.Valeur, 42);

            carac2.Nom        = "Nouveau Nom";
            carac2.Definition = EDefCaracteristique.Defense;
            carac2.Type       = ETypeCaracteristique.Stade;
            carac2.Valeur     = 18;

            Assert.AreEqual(carac2.Nom, "Nouveau Nom");
            Assert.AreEqual(carac2.Definition, EDefCaracteristique.Defense);
            Assert.AreEqual(carac2.Type, ETypeCaracteristique.Stade);
            Assert.AreEqual(carac2.Valeur, 18);
        }
예제 #2
0
 public override String ToString()
 {
     return(c.ToString());
 }