public void TestMethod_Buble_Sort_random_element_list()
        {
            List <int> source   = new List <int>();
            List <int> expected = new List <int>();

            //could be for (int i = 0; i < 10000000; i++) //but way too long
            for (int i = 0; i < 10000; i++)
            {
                source.Add(CryptoFunc.GenerateRndNumberUsingCrypto(1, 254));
                expected.Add(CryptoFunc.GenerateRndNumberUsingCrypto(1, 254));
            }

            List <int> result    = SortFunc.BubbleSort(source);
            bool       isTheSame = true;

            for (int i = 0; i < result.Count; i++)
            {
                if (expected[i] != result[i])
                {
                    isTheSame = false;
                    break;
                }
            }

            Assert.IsFalse(isTheSame);
        }
Exemplo n.º 2
0
        public void TestMethod_GenerateRndNumberUsingCrypto_lesser_than_254()
        {
            int result = CryptoFunc.GenerateRndNumberUsingCrypto(1, 254);

            Assert.IsTrue(result <= 254);
        }
Exemplo n.º 3
0
        public void TestMethod_GenerateRndNumberUsingCrypto_greater_than_1()
        {
            int result = CryptoFunc.GenerateRndNumberUsingCrypto(1, 254);

            Assert.IsTrue(result >= 1);
        }