Пример #1
0
        public ModuleDefinition GetModuleDefinitionFromContent(
            ModuleDescriptor moduleDescriptor,
            ModuleRepository moduleRepository)
        {
            if (m_nameResolutionSemantics == NameResolutionSemantics.ImplicitProjectReferences && moduleDescriptor.Name != PreludeName)
            {
                var moduleConfigurationPath = moduleRepository.RootDir.Combine(moduleRepository.PathTable, Names.ModuleConfigBm);

                return(ModuleDefinition.CreateModuleDefinitionWithImplicitReferences(
                           moduleDescriptor,
                           moduleRepository.RootDir,
                           moduleConfigurationPath,
                           moduleRepository.GetAllPathsForModule(moduleDescriptor),
                           allowedModuleDependencies: null,
                           cyclicalFriendModules: moduleRepository.GetAllModules().Select(
                               descriptor => ModuleReferenceWithProvenance.FromNameAndPath(descriptor.Name, moduleConfigurationPath.ToString(PathTable))),
                           mounts: null));
            }

            return(ModuleDefinition.CreateModuleDefinitionWithExplicitReferencesWithEmptyQualifierSpace(
                       moduleDescriptor,
                       moduleRepository.RootDir.Combine(moduleRepository.PathTable, "FakeMainFile.dsc"),
                       moduleRepository.RootDir.Combine(moduleRepository.PathTable, Names.ModuleConfigBm),
                       moduleRepository.GetAllPathsForModule(moduleDescriptor),
                       PathTable));
        }
Пример #2
0
        public void GetAllModules_ShouldInclude_BeheersingsNiveaus()
        {
            // Arrange
            var context    = new CompetentieAppFrontendContext(_options);
            var repository = new ModuleRepository(context);

            // Act
            var result = repository.GetAllModules().First();

            // Assert
            Assert.IsTrue(result.Competenties.Any(competentie => competentie.BeheersingsNiveau.Niveau.Equals(1)));
        }
Пример #3
0
        public void GetAllModules_Should_Include_Competenties()
        {
            // Arrange
            var context    = new CompetentieAppFrontendContext(_options);
            var repository = new ModuleRepository(context);

            // Act
            var result = repository.GetAllModules().First();

            // Assert
            Assert.IsNotNull(result.Competenties);
        }
Пример #4
0
        public void GetAllModules_Should_Be_Retrieved_From_Database(string moduleCode)
        {
            // Arrange
            var context    = new CompetentieAppFrontendContext(_options);
            var repository = new ModuleRepository(context);

            // Act
            var result = repository.GetAllModules();

            // Assert
            Assert.IsTrue(result.Any(module => module.ModuleCode.Equals(moduleCode)));
        }
Пример #5
0
        public void GetAllModules_Should_Return_Typeof_IList_Of_Modules()
        {
            // Arrange
            var context    = new CompetentieAppFrontendContext(_options);
            var repository = new ModuleRepository(context);

            // Act
            var result = repository.GetAllModules();

            // Assert
            Assert.IsInstanceOfType(result, typeof(IList <Module>));
        }
Пример #6
0
        public void GetAllModules_Should_Include_AuditLogEntries()
        {
            // Arrange
            var context    = new CompetentieAppFrontendContext(_options);
            var repository = new ModuleRepository(context);

            // Act
            var result = repository.GetAllModules().First();

            // Assert
            Assert.IsTrue(result.AuditLogEntries.Any(entry => entry.Omschrijving == "Henk creeerde dit"));
        }
Пример #7
0
        public void GetAllModules_Should_Include_Cohort()
        {
            // Arrange
            var context    = new CompetentieAppFrontendContext(_options);
            var repository = new ModuleRepository(context);

            // Act
            var result = repository.GetAllModules().First();

            // Assert
            Assert.AreEqual("2018-2019", result.Cohort.CohortNaam);
        }
Пример #8
0
        public void GetAllModules_Should_Include_Eindeisen()
        {
            // Arrange
            var context    = new CompetentieAppFrontendContext(_options);
            var repository = new ModuleRepository(context);

            // Act
            var result = repository.GetAllModules().First();

            // Assert
            Assert.IsTrue(result.Eindeisen.Any(eindeis => eindeis.EindeisBeschrijving.Equals("Deze module is erg moeilijk.")));
        }
Пример #9
0
        private SimpleSourceResolverSettings CreateResolverSettingsFromModulesWithContent(
            ModuleRepository moduleRepository, IFileSystem fileSystem)
        {
            var moduleDefinitions = new Dictionary <ModuleDescriptor, ModuleDefinition>();

            foreach (var moduleName in moduleRepository.GetAllModules())
            {
                moduleDefinitions[moduleName] = GetModuleDefinitionFromContent(moduleName, moduleRepository);
            }

            return(new SimpleSourceResolverSettings(moduleDefinitions, fileSystem));
        }
Пример #10
0
        public void GetAllModules_Should_Include_ArchitectuurLagen()
        {
            // Arrange
            var context    = new CompetentieAppFrontendContext(_options);
            var repository = new ModuleRepository(context);

            // Act
            var result = repository.GetAllModules().First();

            // Assert
            Assert.IsTrue(result.Competenties.Any(competentie =>
                                                  competentie.BeheersingsNiveau.ArchitectuurLaag.ArchitectuurLaagNaam.Equals("gebruikersinteractie")));
        }
Пример #11
0
        public void GetAllModules_Should_Include_Perioden()
        {
            // Arrange
            var context    = new CompetentieAppFrontendContext(_options);
            var repository = new ModuleRepository(context);

            // Act
            var result = repository.GetAllModules().First();

            // Assert
            Assert.IsTrue(result.Studiefasen.Any(studiefase =>
                                                 studiefase.Periode.PeriodeNummer == 1));
        }
Пример #12
0
        public void GetAllModules_Should_Include_Specialisaties()
        {
            // Arrange
            var context    = new CompetentieAppFrontendContext(_options);
            var repository = new ModuleRepository(context);

            // Act
            var result = repository.GetAllModules().First();

            // Assert
            Assert.IsTrue(result.Studiefasen.Any(studiefase =>
                                                 studiefase.Specialisatie.Naam.Equals("Propedeuse")));
        }