Пример #1
0
        public void IgnoreUnFluxAvecLeTitreANull()
        {
            JSONReader jsonReader = new JSONExpressBoardReader();
            jsonReader.Connexion();
            jsonReader.FluxSource = Helper.JSON.FluxExpressBoard(Nullable, UrlAnnonce, TypeContrat, Employeur, Ville,
                                                            Salaire, Experience, Commentaires, DateParution, tags);

            IList<Annonce> annonces = jsonReader.RetourneLesOffresDEmploi();

            Assert.AreEqual(0, annonces.Count);
        }
Пример #2
0
        public void SerializeUnFluxAvecLesDonnéesFalcutatifsANull()
        {
            JSONReader jsonReader = new JSONExpressBoardReader();
            jsonReader.Connexion();
            const string nullable = "null";
            jsonReader.FluxSource = Helper.JSON.FluxExpressBoard(Titre, nullable, nullable, Employeur, nullable,
                                                            nullable, nullable, nullable, DateParution, null);

            IList<Annonce> annonces = jsonReader.RetourneLesOffresDEmploi();

            Assert.AreEqual(1, annonces.Count);
            Assert.AreEqual(Titre, annonces[0].Titre);
            Assert.AreEqual(Employeur, annonces[0].Employeur);
            Assert.AreEqual(DateTime.Parse(DateParution), annonces[0].DateParution);
        }
Пример #3
0
        public void SerializeUnFluxVersDesTags()
        {
            JSONReader jsonReader = new JSONExpressBoardReader();
            jsonReader.Connexion();
            const string nullable = "null";
            jsonReader.FluxSource = Helper.JSON.FluxExpressBoard(Titre, nullable, nullable, Employeur, nullable,
                                                            nullable, nullable, nullable, DateParution, tags);

            IList<Annonce> annonces = jsonReader.RetourneLesOffresDEmploi();

            Assert.AreEqual(1, annonces.Count);

            foreach (Tag tag in annonces[0].Tags){
                CollectionAssert.Contains(tags.ToList(), tag.Nom);
            }
        }
Пример #4
0
        public void SerializeUnFluxEnUneAnnonce()
        {
            JSONReader jsonReader = new JSONExpressBoardReader();
            jsonReader.Connexion();
            jsonReader.FluxSource = Helper.JSON.FluxExpressBoard(Titre, UrlAnnonce, TypeContrat, Employeur, Ville,
                                                            Salaire, Experience, Commentaires, DateParution, tags);

            IList<Annonce> annonces = jsonReader.RetourneLesOffresDEmploi();

            Assert.AreEqual(1, annonces.Count);
            Assert.AreEqual(Titre, annonces[0].Titre);
            Assert.AreEqual(UrlAnnonce, annonces[0].Url);
            Assert.AreEqual(TypeContrat, annonces[0].TypeContrat);
            Assert.AreEqual(Employeur, annonces[0].Employeur);
            Assert.AreEqual(Ville, annonces[0].Ville);
            Assert.AreEqual(Salaire, annonces[0].Salaire);
            Assert.AreEqual(Experience, annonces[0].Experience);
            Assert.AreEqual(Commentaires, annonces[0].Description);
            Assert.AreEqual(DateTime.Parse(DateParution), annonces[0].DateParution);
        }
Пример #5
0
 public void ConnexionAuServeurJSon()
 {
     JSONReader jsonReader = new JSONExpressBoardReader();
     jsonReader.Connexion();
 }
Пример #6
0
        public void IgnoreDesTagsVide()
        {
            JSONExpressBoardReader jsonReader = new JSONExpressBoardReader();
            jsonReader.Connexion();
            const string tag = "tag";
            jsonReader.FluxSource = Helper.JSON.FluxExpressBoard(Titre, Nullable, Nullable, Employeur, Nullable,Nullable,
                                                            Nullable, Nullable, DateParution, new List<string>() { string.Empty, null, tag });

            IList<Annonce> annonces = jsonReader.RetourneLesOffresDEmploi();

            Assert.AreEqual(1, annonces.Count);
            Assert.AreEqual(1, annonces[0].Tags.Count);
            Assert.AreEqual(tag, annonces[0].Tags[0].Nom);
        }
Пример #7
0
        public void IgnoreUnFluxAvecLaDateAuMauvaisFormat()
        {
            JSONReader jsonReader = new JSONExpressBoardReader();
            jsonReader.Connexion();
            jsonReader.FluxSource = Helper.JSON.FluxExpressBoard(Titre, UrlAnnonce, TypeContrat, Nullable, Ville,
                                                            Salaire, Experience, Commentaires, "dateIncorrecte", tags);

            IList<Annonce> annonces = jsonReader.RetourneLesOffresDEmploi();

            Assert.AreEqual(0, annonces.Count);
        }