Esempio n. 1
0
        public void RandomBetweenPrecisionCanBeNegativeTest()
        {
            bool canBeNegative = false;

            for (var i = 0; i < 10000; i++)
            {
                var actual = GeneFactory.RandomBetween(-1m, 1m, 0);
                if (actual == -1)
                {
                    canBeNegative = true; break;
                }
            }

            Assert.IsTrue(canBeNegative);
        }
Esempio n. 2
0
        public void RandomBetweenPrecisionCanBeMaximumTest()
        {
            bool canBeMaximum = false;

            for (var i = 0; i < 10000; i++)
            {
                var actual = GeneFactory.RandomBetween(1.1m, 1.2m, 1);
                if (actual == 1.2m)
                {
                    canBeMaximum = true; break;
                }
            }

            Assert.IsTrue(canBeMaximum);
        }
Esempio n. 3
0
        public void RandomBetweenPrecisionTest()
        {
            var actual = GeneFactory.RandomBetween(1.1m, 1.2m, 1);

            Assert.IsTrue(actual >= 1.1m && actual <= 1.2m);
        }
Esempio n. 4
0
        public void RandomBetweenTest()
        {
            var actual = GeneFactory.RandomBetween(0, 1);

            Assert.IsTrue(actual < 2);
        }