Exemplo n.º 1
0
        public void TestGetPokemonWithIds()
        {
            //arrange
            IHomeContext    hc = new HomeTestContext();
            IPokemonContext pc = new PokemonTestContext();
            IAanvalContext  ac = new AanvalTestContext();
            HomeRepo        hr = new HomeRepo(hc, pc, ac);

            List <Pokemon> p    = new List <Pokemon>();
            List <int>     ints = new List <int>();

            ints.Add(50);
            ints.Add(75);
            ints.Add(69);

            //act
            p = hr.GetPokemonWithIds(ints);

            //assert
            foreach (var pokemon in p)
            {
                Assert.IsNotNull(pokemon.Id);
                Assert.AreNotEqual(0, pokemon.Aanvallen.Count);
            }
        }
Exemplo n.º 2
0
        public void TestDrieRandNum()
        {
            //arrange
            List <int> mogelijkeNummers = new List <int>();

            int aantlNummersAlsResultaat = 4;

            for (int i = 23; i <= 26; i++)
            {
                mogelijkeNummers.Add(i);
            }

            IHomeContext    homectx   = new HomeTestContext();
            IPokemonContext pokectx   = new PokemonTestContext();
            IAanvalContext  aanvalctx = new AanvalTestContext();

            HomeRepo hr = new HomeRepo(homectx, pokectx, aanvalctx);

            //act
            List <int> resultaat = hr.XRandNum(mogelijkeNummers, aantlNummersAlsResultaat);

            //assert
            for (int i = 0; i < resultaat.Count; i++)
            {
                for (int j = 0; j < resultaat.Count; j++)
                {
                    if (i != j)
                    {
                        Assert.AreNotEqual(resultaat[i], resultaat[j]);
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void TestReturnHp()
        {
            //arrange
            IHomeContext    homectx   = new HomeTestContext();
            IPokemonContext pokectx   = new PokemonTestContext();
            IAanvalContext  aanvalctx = new AanvalTestContext();

            HomeRepo hr = new HomeRepo(homectx, pokectx, aanvalctx);

            //act
            int hp = hr.ReturnHp();

            //assert
            Assert.AreNotEqual(-1, hp);
        }
Exemplo n.º 4
0
        public void TestNewHp()
        {
            //arange
            IGevechtContext gctx  = new GevechtTestContext();
            IPokemonContext pctx  = new PokemonTestContext();
            IHomeContext    hctx  = new HomeTestContext();
            IAanvalContext  anctx = new AanvalTestContext();
            IAccountContext acctx = new AccountTestContext();

            GevechtRepo gr = new GevechtRepo(gctx, pctx, hctx, anctx, acctx);

            int    oudeHp      = 100;
            Aanval aanval      = new Aanval(1, "Water Pulse", 20, 20, 50, 80, new Soort(Soort.TypeSoorten.Water, "WaterIcon.png"));
            int    randomGetal = 2;

            int nieuweHp         = -1;
            int verwachtUitkomst = 20;

            //act
            nieuweHp = gr.NewHp(oudeHp, aanval, randomGetal);

            //assert
            Assert.AreEqual(verwachtUitkomst, nieuweHp);
        }