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); }
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); } }
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); }
public void IgnoreUnFluxAvecLaDateDeParutionANull() { JSONReader jsonReader = new JSONExpressBoardReader(); jsonReader.Connexion(); jsonReader.FluxSource = Helper.JSON.FluxExpressBoard(Titre, UrlAnnonce, TypeContrat, Employeur, Ville, Salaire, Experience, Commentaires, null, tags); IList<Annonce> annonces = jsonReader.RetourneLesOffresDEmploi(); Assert.AreEqual(0, annonces.Count); }
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); }
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); }