Esempio n. 1
0
        public void TesteGeraInteiroAleatorio()
        {
            GeradorInteiro rng = new GeradorInteiro();
            int            resultado1;
            int            resultado2;

            resultado1 = rng.GerarEntre(1, 1000, rnd);
            resultado2 = rng.GerarEntre(1, 1000, rnd);
            Assert.AreNotEqual(resultado1, resultado2);
        }
Esempio n. 2
0
        public void TesteGeraInteiro()
        {
            GeradorInteiro rng = new GeradorInteiro();
            Random         rnd = new Random();
            int            resultado;

            for (int i = 0; i < 10; i++)
            {
                int min = rnd.Next(0, 100);
                int max = min + rnd.Next(1, 100);

                resultado = rng.GerarEntre(min, max, rnd);
                Assert.IsTrue(resultado >= min && resultado <= max);
            }
        }