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

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

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

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

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