<commit_before>﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DataAccessLayerTest {
    [TestClass]
    public class DalManagerTest {
        [TestMethod]
        public void TestMethod1() {
        }
    }
}<commit_msg>Ajout de tests unitaires sur la création et suppression de stades et jedis<commit_after>﻿using System;
using DataAccessLayer;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using EntitiesLayer;
using System.Collections.Generic;

namespace DataAccessLayerTest {
    [TestClass]

    public class DalManagerTest 
    {
        [TestMethod]
        public void TestAjoutSuppressionJedis() 
        {
            DalManager manager = new DalManager();
            List<Jedi> list1 = manager.getJedis();

            Jedi newJedi = new Jedi(12, "JediTest", true, null);

            manager.UpdateJedi(newJedi);
            List<Jedi> listTemp = list1;
            listTemp.Add(newJedi);

            List<Jedi> list2 = manager.getJedis();
            Assert.AreEqual(list1, list2);

            manager.DeleteJedis(newJedi);
            list2 = manager.getJedis();

            Assert.AreEqual(list1, list2);

        }

        [TestMethod]
        public void TestAjoutSuppressionStades()
        {
            DalManager manager = new DalManager();
            List<Stade> list1 = manager.getStades();

            Stade newStade = new Stade(12, 1000, "PlaneteTest", null);

            manager.UpdateStade(newStade);
            List<Stade> listTemp = list1;
            listTemp.Add(newStade);

            List<Stade> list2 = manager.getStades();
            Assert.AreEqual(list1, list2);

            manager.DeleteStades(newStade);
            list2 = manager.getStades();

            Assert.AreEqual(list1, list2);

        }
    }
}
{'fraction_non_alphanumeric': 0.09409799554565701, 'fraction_numerical': 0.013919821826280624, 'mean_word_length': 2.2378378378378376, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7541309', 'n_tokens_mistral': 543, 'n_tokens_neox': 518, 'n_words': 108}