public void GetCompetentieByCriteria_Should_Return_Typeof_IList_Of_Competenties()
        {
            // Arrange
            using var context = new CompetentieAppFrontendContext(_options);
            var repository = new CompetentieRepository(context);

            // Act
            var result = repository.GetAllCompetentiesByCriteria(new ICompetentieRepository.Criteria
            {
                PeriodeNummer = 1,
                SpecialisatieNaam = "Propedeuse",
                CohortNaam = "2018-2019"
            });

            // Assert
            Assert.IsInstanceOfType(result, typeof(IList<Competentie>));
        }
        public void GetCompetentiesByCriteria_Should_Be_Filtered_By_Criteria()
        {
            // Arrange
            using var context = new CompetentieAppFrontendContext(_options);
            var repository = new CompetentieRepository(context);

            // Act
            var result = repository.GetAllCompetentiesByCriteria(new ICompetentieRepository.Criteria
            {
                PeriodeNummer = 5,
                SpecialisatieNaam = "Forensische ICT",
                CohortNaam = "2018-2019"
            });

            // Assert
            Assert.IsFalse(result.Any());
        }
        public void GetAllCompetentiesByCriteria_Should_Include_Cohort()
        {
            // Arrange
            var context = new CompetentieAppFrontendContext(_options);
            var repository = new CompetentieRepository(context);

            // Act
            var result = repository.GetAllCompetentiesByCriteria(new ICompetentieRepository.Criteria
            {
                PeriodeNummer = 1,
                SpecialisatieNaam = "Propedeuse",
                CohortNaam = "2018-2019"
            }).First();

            // Assert
            Assert.AreEqual("2018-2019", result.Module.Cohort.CohortNaam);
        }
        public void GetCompetentiesByCriteria_Should_Return_Retrieve_Data_From_Database(int moduleId)
        {
            // Arrange
            using var context = new CompetentieAppFrontendContext(_options);
            var repository = new CompetentieRepository(context);

            // Act
            var result = repository.GetAllCompetentiesByCriteria(new ICompetentieRepository.Criteria
            {
                PeriodeNummer = 1,
                SpecialisatieNaam = "Propedeuse",
                CohortNaam = "2018-2019"
            });

            // Assert
            Assert.IsTrue(result.Any(competentie => competentie.ModuleId == moduleId));
        }
        public void GetCompetentiesByCriteria_Should_Include_Module(string moduleCode)
        {
            // Arrange
            using var context = new CompetentieAppFrontendContext(_options);
            var repository = new CompetentieRepository(context);

            // Act
            var result = repository.GetAllCompetentiesByCriteria(new ICompetentieRepository.Criteria
            {
                PeriodeNummer = 1,
                SpecialisatieNaam = "Propedeuse",
                CohortNaam = "2018-2019"
            });

            // Assert
            Assert.IsTrue(result.Any(competentie => competentie.Module.ModuleCode == moduleCode));
        }
        public void GetCompetentiesByCriteria_Should_Include_Competenties_From_Previous_Perioden()
        {
            // Arrange
            using var context = new CompetentieAppFrontendContext(_options);
            var repository = new CompetentieRepository(context);

            // Act
            var result = repository.GetAllCompetentiesByCriteria(new ICompetentieRepository.Criteria
            {
                PeriodeNummer = 5,
                SpecialisatieNaam = "Propedeuse",
                CohortNaam = "2018-2019"
            });

            // Assert
            Assert.IsTrue(result.Any());
        }
        public void GetCompetentiesByCriteria_Should_Include_BeheersingsNiveau(int beheersingsNiveauId)
        {
            // Arrange
            using var context = new CompetentieAppFrontendContext(_options);
            var repository = new CompetentieRepository(context);

            // Act
            var result = repository.GetAllCompetentiesByCriteria(new ICompetentieRepository.Criteria
            {
                PeriodeNummer = 1,
                SpecialisatieNaam = "Propedeuse",
                CohortNaam = "2018-2019"
            });

            // Assert
            Assert.IsTrue(result.Any(competentie => competentie.BeheersingsNiveau.Id == beheersingsNiveauId));
        }