Exemple #1
0
        public void GetCurrentPermutationTest()
        {
            int      size     = 4;
            Permutor permutor = new Permutor(size);
            bool     allOk    = true;

            while (permutor.HasNext())
            {
                permutor.GetNextPermutation();
                int[] current = permutor.GetCurrentPermutation();
                if (ArrayElementsDistinct(current))
                {
                    continue;
                }
                else
                {
                    allOk = false;
                    break;
                }
            }
            Assert.IsTrue(allOk);
        }