Exemple #1
0
 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();
     }
 }
Exemple #2
0
 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();
     }
 }
Exemple #3
0
 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();
     }
 }