using FakeBank_DAL.Domains;
using FakeBank_DAL.Implementations;
using FakeBank_DAL.Reposity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FakeBank
{
    class Program
    {
        static void Main(string[] args)
        {
            Test_DAL_Create_CompteEpargne();

            System.Console.ReadKey();
        }


        private static void Test_DAL_Create_Transaction()
        {
            Console.WriteLine("==== Testing Create Transaction  =====");

            IGenericReposity<Transaction> repo = new GenericRepesitory<Transaction>();
            var resultat = repo.Create(new Transaction { Montant = 10 , Sens = "in", DateTransaction = DateTime.Now });
            Console.WriteLine(resultat);
        }

        private static void Test_DAL_Create_CompteCheque()
        {
            Console.WriteLine("==== Testing Create Compte  =====");

            IGenericReposity<CompteCheque> repo = new GenericRepesitory<CompteCheque>();
            var resultat = repo.Create(new CompteCheque { Numero = "10", Solde = 200, ValeurDeLaFacilité =10 });
            Console.WriteLine(resultat);
        }

        private static void Test_DAL_Create_CompteEpargne()
        {
            Console.WriteLine("==== Testing Create Compte  =====");

            IGenericReposity<CompteEpargne> repo = new GenericRepesitory<CompteEpargne>();
            var resultat = repo.Create(new CompteEpargne { Numero = "10", Solde = 200 , TypeEpargne="retraite"});


            Console.WriteLine(resultat);
        }

        private static void Test_DAL_FindAll_Transaction()
        {
            Console.WriteLine("==== Testing FindAll Transaction =====");
            IGenericReposity<Transaction> repo = new GenericRepesitory<Transaction>();

            foreach (var item in repo.FindAll())
            {
                Console.WriteLine(item);
            }
        }

        private static void Test_DAL_FindAll_Compte()
        {
            Console.WriteLine("==== Testing FindAll Compte =====");
            IGenericReposity<Compte> repo = new GenericRepesitory<Compte>();
            foreach (var item in repo.FindAll())
            {
                Console.WriteLine(item);
            }
        }

        private static void Test_DAL_FindById_Transaction()
        {
            Console.WriteLine("==== Testing FindById Transaction =====");
            IGenericReposity<Transaction> repo = new GenericRepesitory<Transaction>();
            var resultat = repo.FindById(1);
            if (resultat != null)
                Console.WriteLine(resultat);
        }

        private static void Test_DAL_FindById_Compte()
        {
            Console.WriteLine("==== Testing FindById Compte =====");
            IGenericReposity<Compte> repo = new GenericRepesitory<Compte>();
            var resultat = repo.FindById(1);
            if (resultat != null)
                Console.WriteLine(resultat);
        }





    }


}
