コード例 #1
0
        public void TestAddVertexWithEdge()
        {
            try
            {
                //ClientGraphRepository repo = new ClientGraphRepository("Graphe_Essay", "graph_cv");
                //List<Client> listOfClient;

                //Guid identifier = Guid.NewGuid();

                //Client client = new Client();
                //client.Nom = identifier.ToString();

                //Mandat mandat = new Mandat();
                //mandat.Numero = "999";
                //mandat.Projet = "Essay de persistence";
                //mandat.Fonction = "Developeur";
                //mandat.Envenrgure = "159";
                //mandat.Description = "Loren Ipsum";

                //client.Mandats.Add(mandat);

                //repo.Add(client);

                //listOfClient = repo.GetAll();

                //Assert.IsTrue(listOfClient.Any(x => x.Nom == identifier.ToString()));
            }
            catch (System.Exception e)
            {
                throw;
            }


            ConseillerGraphRepository  conseillerGraphRepository  = new ConseillerGraphRepository("Graphe_Essay", "graph_cv");
            TechnologieGraphRepository technologieGraphRepository = new TechnologieGraphRepository("Graphe_Essay", "graph_cv");

            List <Conseiller>  conseiller      = conseillerGraphRepository.GetAll();
            List <Technologie> technologie     = technologieGraphRepository.GetAll();
            List <bool>        hasEdgesResults = new List <bool>();
            Edge edge = new Edge("Knows");

            foreach (var item in conseiller)
            {
                foreach (var item2 in technologie)
                {
                    hasEdgesResults.Add(conseillerGraphRepository.HasEdge(edge, item, item2));
                }
            }


            Assert.IsTrue(hasEdgesResults.Any(x => x));
        }
コード例 #2
0
        public void TestDAssemblageMandat()
        {
            ConseillerGraphRepository conseillerGraphRepository;
            Conseiller conseiller;

            DirectoryInfo extractedDirectory;
            string        gabaritDirectoryPath = @"..\\..\\..\\Gabarits";

            try
            {
                CVGenerator generator = new CVGenerator();
                conseillerGraphRepository = new ConseillerGraphRepository("Graphe_Essay", "graph_cv");

                extractedDirectory = new DirectoryInfo($"{gabaritDirectoryPath}\\Modele_a_generer");
                if (extractedDirectory.Exists)
                {
                    extractedDirectory.Delete(true);
                }

                extractedDirectory = null;

                conseillerGraphRepository.DeleteAllDocs();
                generator.ProcessCV(gabaritDirectoryPath);

                conseiller = conseillerGraphRepository.GetAll().First();

                foreach (Mandat mandat in conseiller.Mandats)
                {
                    Assert.IsNotNull(mandat.Projet);
                    Assert.AreEqual(7, mandat.Projet.Technologies.Count);
                    Assert.IsNotNull(mandat.Projet.Client);
                    Assert.IsNotNull(mandat.Projet.SocieteDeConseil);
                }
            }
            finally
            {
                FileInfo fileInfo = new FileInfo($"{gabaritDirectoryPath}\\Modele_a_generer.xml");
                if (fileInfo.Exists)
                {
                    fileInfo.Delete();
                }
            }
        }