public void FctQuiLeDernierElement() { LinqImpl linqImpl = new LinqImpl(); var resultat = linqImpl.DernierElement(); Assert.Equal("train", resultat); }
public void FctRetourneNullSiIlYAPlusDUnElement() { LinqImpl linqImpl = new LinqImpl(); var resultat = linqImpl.SeulElementOuNull('z'); Assert.Null(resultat); }
public void FctQuiRetourneLesMotsOrdonnesContenantUnCaractere() { LinqImpl linqImpl = new LinqImpl(); var expected = new[] { "armoire", "avion", "chaine", "chat", "étagère", "maison", "train" }; var resultat = linqImpl.Contient('a'); Assert.Equal(expected, resultat); }
public void FctQuiLeSeulElement() { LinqImpl linqImpl = new LinqImpl(); linqImpl.liste = new [] { linqImpl.liste.First() }; var resultat = linqImpl.SeulElement('a'); Assert.Equal("avion", resultat); }
public void RetourneNullSiLELementNHexistePas() { LinqImpl linqImpl = new LinqImpl(); string expected = null; var resultat = linqImpl.PremierElementOuNull('z'); Assert.Equal(expected, resultat); }
public void RetourneLePremierElementContenantUnCaractere2() { LinqImpl linqImpl = new LinqImpl(); var expected = "armoire"; var resultat = linqImpl.PremierElementOuNull('e'); Assert.Equal(expected, resultat); }
public void FctRetourne5ElementsSansLes5Premiers() { LinqImpl linqImpl = new LinqImpl(); var resultat = linqImpl.SkipFiveTakeFive(); Assert.Equal(new[] { "chat", "bière", "C#", "chaine", "maison" }, resultat); }
public void FctRetourne5PremierElements() { LinqImpl linqImpl = new LinqImpl(); var resultat = linqImpl.FirstFive(); Assert.Equal(new[] { "avion", "armoire", "étagère", "mère", "chien" }, resultat); }
public void FctRetourneLesEgalites() { string[] param = { "armoire", "étagère", "mère", "chaussure" }; LinqImpl linqImpl = new LinqImpl(); var resultat = linqImpl.Similaire(param); Assert.Equal(new[] { "armoire", "étagère", "mère" }, resultat); }
public void FctPlanteSiIlYAPLusDUnElement() { LinqImpl linqImpl = new LinqImpl(); Assert.Throws <InvalidOperationException>(() => linqImpl.SeulElement('a')); }
public void RetourneUneExceptionSiLELementNHexistePas() { LinqImpl linqImpl = new LinqImpl(); Assert.Throws <InvalidOperationException>(() => linqImpl.PremierElement('z')); }