Exemplo n.º 1
0
        public void GenerateId_ShouldReturnNextId()
        {
            HeroesService heroesService = new HeroesService();

            int id = heroesService.GenerateId();

            Assert.AreEqual(id, heroesService.GetHeroes().Last().Id + 1);
        }
Exemplo 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);
        }