Пример #1
0
        public void GeneratesRandomInt()
        {
            for (int i = 0; i < new Random().Next(5, 20); i++)
            {
                int v1 = RandomUtilities.GetRandomInteger();
                int v2 = RandomUtilities.GetRandomInteger(v1);
                Assert.AreNotEqual(v1, v2);

                v1 = RandomUtilities.GetRandom <int>();
                Assert.IsInstanceOfType(v1, typeof(int));

                v2 = RandomUtilities.GetRandom(v1);
                Assert.IsInstanceOfType(v2, typeof(int));
                Assert.AreNotEqual(v1, v2);

                v1 = RandomUtilities.GetRandom(typeof(int));
                Assert.IsInstanceOfType(v1, typeof(int));

                v2 = RandomUtilities.GetRandom(typeof(int), v1);
                Assert.IsInstanceOfType(v2, typeof(int));
                Assert.AreNotEqual(v1, v2);
            }
        }