public void add_new_hero()
        {
            HeroesService heroes = new HeroesService();

            Hero chris = new Hero();

            chris.Name  = "Chris";
            chris.Pic   = "https://making-the-web.com/sites/default/files/clipart/142014/stick-figure-142014-5551841.jpg";
            chris.Power = 2;

            heroes.Add(chris);

            Hero ashazi = new Hero();

            ashazi.Name  = "Ashazi";
            ashazi.Pic   = "http://clipart-library.com/images/pio5eXK6T.png";
            ashazi.Power = 3;

            heroes.Add(ashazi);

            Hero pasha = new Hero();

            pasha.Name  = "Pasha";
            pasha.Pic   = "https://image.shutterstock.com/image-vector/stick-figure-business-ideas-260nw-220840597.jpg";
            pasha.Power = 4;

            heroes.Add(pasha);

            Hero marcus = new Hero();

            marcus.Name  = "Marcus";
            marcus.Pic   = "https://image.shutterstock.com/image-vector/stick-figure-celebration-cheer-260nw-331595411.jpg";
            marcus.Power = 2;

            heroes.Add(marcus);

            Hero dale = new Hero();

            dale.Name  = "Dale";
            dale.Pic   = "https://images2.minutemediacdn.com/image/upload/c_crop,h_1180,w_2100,x_0,y_94/f_auto,q_auto,w_1100/v1555001162/shape/mentalfloss/504106-wikipedia.jpg";
            dale.Power = 5;

            heroes.Add(dale);

            Assert.AreEqual(5, heroes.GetHeroes().Count());
        }
Esempio n. 2
0
        public void Add_AddANewHero_WhenHeroPassed()
        {
            HeroesService heroesService = new HeroesService();

            Hero hero = new Hero()
            {
                Name  = "kyle",
                Pic   = "https://images2.minutemediacdn.com/image/upload/c_crop,h_1180,w_2100,x_0,y_94/f_auto,q_auto,w_1100/v1555001162/shape/mentalfloss/504106-wikipedia.jpg",
                Power = 1.5
            };

            int id = heroesService.GenerateId();

            hero.Id = id;
            heroesService.Add(hero);

            Assert.AreEqual(id, heroesService.GetHeroes().Last().Id);
        }