예제 #1
0
        public void RandomOrg_GenerateGaussians_Standard()
        {
            RandomOrgClient proxy = new RandomOrgClient(Constants.ApiKey);
            double[] result = proxy.GetGaussians(100);

            Assert.IsTrue(result.Length == 100);
        }
예제 #2
0
        public void RandomOrg_GenerateGaussians_Specific()
        {
            RandomOrgClient proxy = new RandomOrgClient(Constants.ApiKey);
            double[] result = proxy.GetGaussians(100, 20, 100, 6);

            Assert.IsTrue(result.Length == 100);

            bool lengthCorrect = true;
            for (int i = 0; i < result.Length; i++)
            {
                lengthCorrect &= (result[i] > 0 && result[i].ToString().Length <= 8) || (result[i] < 0 && result[i].ToString().Length <= 9);
            }
            Assert.IsTrue(lengthCorrect);
        }