public static List <HeroJson> ToJsonListHero(this List <Hero> l) { List <HeroJson> NewList = new List <HeroJson>(); foreach (Hero h in l) { HeroJson hjson = h.ToJsonHero(); if (hjson.CheckValidity()) { NewList.Add(hjson); } } return(NewList); }
public void TestHeroInvalidFile() { HeroJson Hero = new HeroJson("id", "test", "ImagesMovies/ironMan8.png", "desc", 0, 0, 0); Assert.IsFalse(Hero.CheckValidity()); }
public void TestHeroInvalidDesc() { HeroJson Hero = new HeroJson("", " ", "ImagesMovies/ironMan.png", "desc", 0, 0, 0); Assert.IsFalse(Hero.CheckValidity()); }
public void TestHeroInvalidID() { HeroJson Hero = new HeroJson("", "test", "ImagesHero/ironMan.png", "desc", 0, 0, 0); Assert.IsFalse(Hero.CheckValidity()); }
public void TestSerieValid() { HeroJson Serie = new HeroJson("test", "test", "ImagesHero/ironMan.png", "desc", 0, 0, 0); Assert.IsTrue(Serie.CheckValidity()); }
public void TestHeroValid() { HeroJson Hero = new HeroJson("test", "test", "ImagesHero/ironMan.png", "desc", 0, 0, 0); Assert.IsTrue(Hero.CheckValidity()); }