public void RunSinglePredefinedJson()
        {
            Logger.Get().StartCollectingAllMessages();
            Logger.Threshold = Severity.Debug;
            const string srcfile = @"V:\Dropbox\LPGReleases\releases9.4.0\ExampleHouseJob-1.json";

            using (WorkingDir wd = new WorkingDir(Utili.GetCurrentMethodAndClass())) {
                using (DatabaseSetup db = new DatabaseSetup(Utili.GetCurrentMethodAndClass())) {
                    FileInfo srcfi      = new FileInfo(srcfile);
                    string   targetfile = wd.Combine(srcfi.Name);
                    string   targetdb   = wd.Combine("profilegenerator.db3");
                    File.Copy(db.FileName, targetdb, true);
                    srcfi.CopyTo(targetfile, true);
                    Directory.SetCurrentDirectory(wd.WorkingDirectory);
                    HouseGenerator houseGenerator = new HouseGenerator();
                    houseGenerator.ProcessSingleHouseJob(targetfile, null);
                }
            }
        }
        public static void RunSingleHouse(Func <Simulator, HouseCreationAndCalculationJob> makeHj,
                                          Action <string> checkResults)
        {
            Logger.Get().StartCollectingAllMessages();
            Logger.Threshold = Severity.Debug;
            using (var wd = new WorkingDir(Utili.GetCallingMethodAndClass())) {
                using (var db = new DatabaseSetup(Utili.GetCallingMethodAndClass())) {
                    wd.SkipCleaning = true;
                    var targetdb = wd.Combine("profilegenerator.db3");
                    File.Copy(db.FileName, targetdb, true);
                    Directory.SetCurrentDirectory(wd.WorkingDirectory);
                    var sim            = new Simulator(db.ConnectionString);
                    var houseGenerator = new HouseGenerator();
                    var hj             = makeHj(sim);
                    houseGenerator.ProcessSingleHouseJob(hj, null, sim);
                    if (hj.CalcSpec == null)
                    {
                        throw new LPGException("calcspec was null");
                    }

                    checkResults(wd.Combine(hj.CalcSpec.OutputDirectory));
                }
            }
        }
        private static void StartHouseJob([JetBrains.Annotations.NotNull] HouseCreationAndCalculationJob houseJob, [JetBrains.Annotations.NotNull] WorkingDir wd,
                                          string fnSuffix)
        {
            string houseJobFile = wd.Combine("houseJob." + fnSuffix + ".json");

            if (File.Exists(houseJobFile))
            {
                File.Delete(houseJobFile);
            }

            using (StreamWriter sw = new StreamWriter(houseJobFile)) {
                sw.WriteLine(JsonConvert.SerializeObject(houseJob, Formatting.Indented));
                sw.Close();
            }

            Logger.Info("======================================================");

            Logger.Info("======================================================");
            Logger.Info("starting house generation");
            Logger.Info("======================================================");
            HouseGenerator houseGenerator = new HouseGenerator();

            houseGenerator.ProcessSingleHouseJob(houseJobFile, null);
        }