public void CreateTableFromFieldlistTest() { using (WorkingDir wd = new WorkingDir(Utili.GetCurrentMethodAndClass())) { wd.ClearDirectory(); var srl = new SqlResultLoggingService(wd.WorkingDirectory); SqlResultLoggingService.FieldDefinition fd = new SqlResultLoggingService.FieldDefinition("name", "text"); List <SqlResultLoggingService.FieldDefinition> fields = new List <SqlResultLoggingService.FieldDefinition> { fd }; srl.MakeTableForListOfFields(fields, new HouseholdKey("hh0"), "tbl1"); wd.CleanUp(); } }
public void SaveDictionaryCalcParametersTest() { using (WorkingDir wd = new WorkingDir(Utili.GetCurrentMethodAndClass())) { wd.ClearDirectory(); var srl = new SqlResultLoggingService(wd.WorkingDirectory); var hhkey = new HouseholdKey("hh0"); ResultTableDefinition rtd = new ResultTableDefinition("tbl1", ResultTableID.AffordanceDefinitions, "tabledesc", CalcOption.BasicOverview); SaveableEntry se = new SaveableEntry(hhkey, rtd); se.AddField("Name", SqliteDataType.Text); se.AddField("Json", SqliteDataType.Text); se.AddRow(RowBuilder.Start("Name", "first").Add("Json", "[]").ToDictionary()); srl.SaveResultEntry(se); wd.CleanUp(); } }
public void DoubleSaveDictionaryTest() { using (WorkingDir wd = new WorkingDir(Utili.GetCurrentMethodAndClass())) { wd.ClearDirectory(); var srl = new SqlResultLoggingService(wd.WorkingDirectory); SqlResultLoggingService.FieldDefinition fd = new SqlResultLoggingService.FieldDefinition("name", "text"); List <SqlResultLoggingService.FieldDefinition> fields = new List <SqlResultLoggingService.FieldDefinition> { fd }; var hhkey = new HouseholdKey("hh0"); srl.MakeTableForListOfFields(fields, hhkey, "tbl1"); Dictionary <string, object> values = new Dictionary <string, object> { { "name", "blub" } }; srl.SaveDictionaryToDatabaseNewConnection(values, "tbl1", hhkey); wd.CleanUp(); } }