Пример #1
0
        private void LoadDataInCache(IMemoryCache cache)
        {
            TechnologieGraphRepository technologieGraphRepository = new TechnologieGraphRepository();
            LangueGraphRepository      langueGraphRepository      = new LangueGraphRepository();
            FonctionGraphRepository    fonctionGraphRepository    = new FonctionGraphRepository();

            cache.Set("Technologies", technologieGraphRepository.GetAll());
            cache.Set("Langues", langueGraphRepository.GetAll());
            cache.Set("Fonctions", fonctionGraphRepository.GetAll());
        }
Пример #2
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));
        }