﻿using Groups;
using Groups.Standard;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Groups.Core;
using Groups_Test.Core;

namespace Groups_Test.Standard
{
    public class CyclicGroup_TestDataBuilder
    {
        public CyclicGroup_TestData CreateData()
        {
            var C1 = CyclicGroup.Create(1);
            var C2 = CyclicGroup.Create(2);
            var C3 = CyclicGroup.Create(3);
            var C5 = CyclicGroup.Create(5);
            var C7 = CyclicGroup.Create(7);
            var C10 = CyclicGroup.Create(10);
            var C100 = CyclicGroup.Create(100);

            var groups = new List<CyclicGroup>
            {
                C1, C2, C3, C5, C7, C10, C100
            };

            var testData = new CyclicGroup_TestData
            {
                Groups = groups,

                SubgroupGenerationWithoutH = new List<(Group G, GroupElement[] generators)>
                {
                    (C10, new GroupElement[] { C10.Generator.Pow(2) }),
                    (C10, new GroupElement[] { C10.Generator.Pow(5) }),
                    (C100, new GroupElement[] { C10.Generator.Pow(2) }),
                    (C100, new GroupElement[] { C10.Generator.Pow(4) })
                },

                SubgroupGenerationWithH = new List<(Group G, Group H, GroupElement[] generators)>
                {
                    (C10, C5, new GroupElement[] { C2.Generator })
                },

                UnrelatedElement = Permutation.IdentityPermutation(1),

                UnrelatedGroup = SymmetricGroup.Create(1),

                SubgroupGenerationTestData = new List<Group_SubgroupGenerationTestCase>
                {
                    new Group_SubgroupGenerationTestCase { Group = C2, Subgroup = C1, NonSubgroup = C10 },
                    new Group_SubgroupGenerationTestCase { Group = C10, Subgroup = C5, NonSubgroup = C7 },
                },

                IsAbelianData = new List<(Group G, bool IsAbelian)>
                {
                    (C1, true),
                    (C2, true),
                    (C3, true),
                    (C10, true)
                },

                GroupDetails = new List<(CyclicGroup G, int Degree)>
                {
                    (C1, 1),
                    (C2, 2),
                    (C3, 3),
                    (C5, 5),
                    (C7, 7),
                    (C10, 10),
                    (C100, 100)
                },

                IsCyclicData = new List<(Group G, bool IsCyclic)>
                {
                    (C1, true),
                    (C2, true),
                    (C3, true),
                    (C10, true)
                },

                CountData = new List<(Group G, int Count)>
                {
                    (C1, 1),
                    (C2, 2),
                    (C3, 3),
                    (C5, 5),
                    (C7, 7),
                    (C10, 10),
                    (C100, 100)
                }
            };

            return testData;
        }
    }
}
