Example #1
0
    public void ValidIfReturnsHeroWithHighPoints(string message)
    {
        TestHeroRep.Create(testHeroOne);
        TestHeroRep.Create(new Hero("Ivan", 30));
        TestHeroRep.Create(new Hero("Bai", 60));
        Hero returnHero = TestHeroRep.GetHeroWithHighestLevel();

        Assert.AreEqual("Bai", returnHero.Name, message);
    }
Example #2
0
    public void MothodShouldReturnHeroWithHighestLevel()
    {
        Hero hero  = new Hero("Gosho", 16);
        Hero hero1 = new Hero("Pesho", 12);

        heroRepository.Create(hero);
        heroRepository.Create(hero1);

        Assert.AreEqual(hero, heroRepository.GetHeroWithHighestLevel());
    }
Example #3
0
    public void GetHeroWithHighestLevel()
    {
        heros.Create(hero);

        Hero heroTwo = new Hero("Ivan", 11);

        heros.Create(heroTwo);

        Assert.That(() => heros.GetHeroWithHighestLevel(), Is.EqualTo(heroTwo));
    }
Example #4
0
    public void TestGetHeroWithHighestLevel()
    {
        heroRep.Create(hero);
        heroRep.Create(new Hero("name1", 100));
        heroRep.Create(new Hero("best", 155));
        Hero bestHeroResult = heroRep.GetHeroWithHighestLevel();

        Assert.AreEqual(bestHeroResult.Name, "best");
        Assert.AreEqual(bestHeroResult.Level, 155);
    }
    public void GetHeroWithHighestLevelWorkCorrectly()
    {
        heroRepository.Create(hero);
        heroRepository.Create(new Hero("gosho", 22));
        heroRepository.Create(new Hero("Kotka", 1));
        var heigstlevelHeero = heroRepository.GetHeroWithHighestLevel();

        Assert.AreEqual("gosho", heigstlevelHeero.Name);
        Assert.AreEqual(22, heigstlevelHeero.Level);
    }
    public void GetHeroWithHighestLevelSgouldReturnCorect()
    {
        Hero hero2 = new Hero("Bani", 23);

        this.heroRepository.Create(hero);
        this.heroRepository.Create(hero2);

        Hero actual = heroRepository.GetHeroWithHighestLevel();

        Assert.AreEqual(hero2, actual);
    }
Example #7
0
    public void ReturnsHeroWithSameLevel()
    {
        Hero           hero1      = new Hero("Ivan", 15);
        Hero           hero2      = new Hero("Rus", 15);
        HeroRepository repository = new HeroRepository();

        repository.Create(hero1);
        repository.Create(hero2);

        Assert.AreEqual(hero1, repository.GetHeroWithHighestLevel());
    }
    public void ReturningHeroWithHighestLevelShouldWorkCorrectly()
    {
        var newHero  = new Hero("Ivan", 44);
        var newHero2 = new Hero("Gosho", 45);

        repo.Create(newHero);
        repo.Create(hero);
        repo.Create(newHero2);

        Assert.AreEqual(newHero2, repo.GetHeroWithHighestLevel());
        Assert.AreEqual(hero, repo.GetHero("Ivo"));
    }
Example #9
0
    public void Get_Hero_With_Highest_Level()
    {
        HeroRepository repository = new HeroRepository();

        repository.Create(new Hero("Gosho", 1));
        repository.Create(new Hero("Ivo", 3));
        repository.Create(new Hero("Kiro", 10));

        var result = repository.GetHeroWithHighestLevel();

        Assert.AreEqual(result.Name, "Kiro");
    }
        public void GetHeroWithHighestLevelWorkCorrectly()
        {
            Hero           niko   = new Hero("Nikolay", 25);
            Hero           poli   = new Hero("Pavlina", 28);
            HeroRepository heroes = new HeroRepository();

            heroes.Create(niko);
            heroes.Create(poli);
            Hero expectedHero = poli;

            Hero actualHero = heroes.GetHeroWithHighestLevel();

            Assert.That(expectedHero, Is.EqualTo(actualHero));
        }
    public void GetHeroWithHighestLevelShouldWorkCorrectly()
    {
        var rep   = new HeroRepository();
        var hero  = new Hero("Ivan", 12);
        var hero2 = new Hero("Pesho", 20);

        rep.Create(hero);
        rep.Create(hero2);

        var expected = hero2;
        var actual   = rep.GetHeroWithHighestLevel();

        Assert.AreEqual(expected, actual);
    }
    public void GetHeroWithHighestLevelTest()
    {
        heroRepository = new HeroRepository();

        Hero hero  = new Hero("Gosho", 11);
        Hero hero2 = new Hero("Pesho", 12);

        heroRepository.Create(hero);
        heroRepository.Create(hero2);

        Hero HLH = heroRepository.GetHeroWithHighestLevel();

        Assert.AreEqual("Pesho", HLH.Name);
    }
Example #13
0
    public void CheckGetHeroWithHighestLevel()
    {
        var  heroRepository = new HeroRepository();
        Hero hero1          = new Hero("zaza", 4);
        Hero hero2          = new Hero("zeze", 7);
        Hero hero4          = new Hero("zizi", 13);

        heroRepository.Create(hero1);
        heroRepository.Create(hero2);
        heroRepository.Create(hero4);

        var result = heroRepository.GetHeroWithHighestLevel();

        Assert.AreEqual(hero4, result);
    }
Example #14
0
    public void GetHeroWithHighestLevel_ReturnValidHero()
    {
        Hero hero1 = new Hero("Hero1", 100);
        Hero hero2 = new Hero("Hero2", 200);
        Hero hero3 = new Hero("Hero3", 50);
        Hero hero4 = new Hero("Hero4", 180);

        this.heroRepository.Create(hero1);
        this.heroRepository.Create(hero2);
        this.heroRepository.Create(hero3);
        this.heroRepository.Create(hero4);

        Hero hero = heroRepository.GetHeroWithHighestLevel();

        Assert.AreSame(hero2, hero);
    }
    public void GetHeroWithighestLevel()
    {
        var name1    = "Ivan1";
        var level1   = 15;
        var name2    = "Ivan2";
        var level2   = 10;
        var heroRepo = new HeroRepository();

        var hero1 = new Hero(name1, level1);
        var hero2 = new Hero(name2, level2);

        heroRepo.Create(hero1);
        heroRepo.Create(hero2);

        Assert.AreEqual(hero1, heroRepo.GetHeroWithHighestLevel());
    }
    public void GetHeroWithHighestLevelShouldReturnCorrectly()
    {
        HeroRepository heroRepository = new HeroRepository();
        Hero           hero           = new Hero("Ivan", 1);
        Hero           hero2          = new Hero("George", 120);
        Hero           hero3          = new Hero("Edward", 13);
        Hero           hero4          = new Hero("Lucy", 14);

        heroRepository.Create(hero);
        heroRepository.Create(hero2);
        heroRepository.Create(hero3);
        heroRepository.Create(hero4);

        Hero expectedResult = heroRepository.GetHeroWithHighestLevel();

        Assert.That(expectedResult, Is.EqualTo(hero2));
    }
    public void Get_Hero_With_Highest_Levels_Works()
    {
        var repository = new HeroRepository();

        var hero1 = new Hero("Gosho", 5);

        repository.Create(hero1);
        var hero2 = new Hero("Kiro", 10);

        repository.Create(hero2);
        var hero3 = new Hero("Pesho", 7);

        repository.Create(hero3);

        var result = repository.GetHeroWithHighestLevel();

        Assert.AreEqual(hero2, result);
    }