public MutableDictionaryObject DocumentInitialize() { MutableDictionaryObject dico = new MutableDictionaryObject(); dico.SetString("table", Table); if (DateNaissance != DateTime.MinValue) { dico.SetDate("dateNaissance", DateNaissance); } dico.SetString("email", Email); dico.SetString("lieuNaissance", LieuNaissance); dico.SetString("lieuTravail", LieuTravail); dico.SetString("nationalite", Nationalite); dico.SetString("nom", Nom); dico.SetString("portable", Portable); dico.SetString("prenom", Prenom); dico.SetString("profession", Profession); dico.SetDouble("salaireNetMensuel", SalaireNetMensuel ?? 0); dico.SetString("telPro", TelPro); dico.SetString("titreSejour", TitreSejour); dico.SetString("profession", Profession); dico.SetString("civCode", CivCode); dico.SetString("civLibelle", CivLibelle); return(dico); }
public MutableDictionaryObject DocumentInitialize() { MutableDictionaryObject dico = new MutableDictionaryObject(); dico.SetString("table", Table); if (Num != null) { dico.SetLong("num", Num ?? 0); } dico.SetLong("pgrNum", PgrNum); dico.SetString("code", Code); dico.SetDouble("surface", Surface); dico.SetDouble("surfacePlancher", SurfacePlancher); dico.SetString("facade", Facade); dico.SetString("letCode", LetCode); dico.SetString("etat", Etat); dico.SetDouble("prixVenteConseille", PrixVenteConseille ?? 0); return(dico); }
public void TestSetOthers() { // Uncovered by other tests var dict = new MutableDictionaryObject(); dict.SetFloat("pi", 3.14f); dict.SetDouble("better_pi", 3.14159); dict.SetBoolean("use_better", true); dict.GetFloat("pi").Should().Be(3.14f); dict.GetDouble("better_pi").Should().Be(3.14159); dict.GetDouble("pi").Should().BeApproximately(3.14, 0.00001); dict.GetFloat("better_pi").Should().BeApproximately(3.14159f, 0.0000000001f); dict.GetBoolean("use_better").Should().BeTrue(); }
protected override DictionaryObject DoPrediction(DictionaryObject input) { var numbers = input.GetArray("numbers"); if (numbers == null) { return(null); } var output = new MutableDictionaryObject(); output.SetLong("sum", numbers.Cast <long>().Sum()); output.SetLong("min", numbers.Cast <long>().Min()); output.SetLong("max", numbers.Cast <long>().Max()); output.SetDouble("avg", numbers.Cast <long>().Average()); return(output); }