public void CalcAffordanceDtoLoggerTest()
        {
            using (WorkingDir wd = new WorkingDir(Utili.GetCurrentMethodAndClass()))
            {
                CalcAffordanceDtoLogger ael    = new CalcAffordanceDtoLogger(wd.SqlResultLoggingService);
                HouseholdKey            key    = new HouseholdKey("hhkey");
                List <IDataSaverBase>   savers = new List <IDataSaverBase>
                {
                    ael
                };
                InputDataLogger idl = new InputDataLogger(savers.ToArray());
                //CalcLoadTypeDto cldto = new CalcLoadTypeDto("loadtype", 1, "kw", "kwh", 1, true, "guid");
                CalcProfileDto cpd = new CalcProfileDto("name", 1, ProfileType.Absolute, "source", Guid.NewGuid().ToStrGuid());
                AvailabilityDataReferenceDto adrd  = new AvailabilityDataReferenceDto("blub", "availguid".ToStrGuid());
                CalcAffordanceDto            cadto = new CalcAffordanceDto("blub", 1, cpd, "locname", "locguid".ToStrGuid(), true, new List <CalcDesireDto>(),
                                                                           1, 100, PermittedGender.All, true, 1, 1, 1, 1, "affcat", false, false, new List <CalcAffordanceVariableOpDto>(),
                                                                           new List <VariableRequirementDto>(), ActionAfterInterruption.GoBackToOld,
                                                                           "timelimitname", 100, true, "srctrait", "guid".ToStrGuid(), adrd, key, BodilyActivityLevel.Low);

                cadto.AddDeviceTuple("devname", "deviguid".ToStrGuid(), cpd, "calcloadtypename", "loadtypeguid".ToStrGuid(), 1, new TimeSpan(0, 1, 0), 1, 1);
                List <IHouseholdKey> aes = new List <IHouseholdKey>
                {
                    cadto
                };
                idl.SaveList(aes);
                var res = ael.Load(key);
                var s1  = JsonConvert.SerializeObject(aes, Formatting.Indented);
                var s2  = JsonConvert.SerializeObject(res, Formatting.Indented);
                s1.Should().Be(s2);
                wd.CleanUp();
            }
        }
 public void RunTest()
 {
     using (WorkingDir wd = new WorkingDir(Utili.GetCurrentMethodAndClass()))
     {
         ActionEntryLogger     ael    = new ActionEntryLogger(wd.SqlResultLoggingService);
         HouseholdKey          key    = new HouseholdKey("hhkey");
         List <IDataSaverBase> savers = new List <IDataSaverBase>
         {
             ael
         };
         InputDataLogger idl = new InputDataLogger(savers.ToArray());
         TimeStep        ts  = new TimeStep(1, 0, true);
         ActionEntry     ae1 = new ActionEntry("blub", key, ts, DateTime.Now, "123".ToStrGuid(), "name", false,
                                               "affname", "affguid".ToStrGuid(), 0, BodilyActivityLevel.Low);
         List <IHouseholdKey> aes = new List <IHouseholdKey>
         {
             ae1
         };
         idl.SaveList(aes);
         var res = ael.Read(key);
         var s1  = JsonConvert.SerializeObject(aes, Formatting.Indented);
         var s2  = JsonConvert.SerializeObject(res, Formatting.Indented);
         s1.Should().Be(s2);
         wd.CleanUp();
     }
 }
 public void ReadTest()
 {
     using (WorkingDir wd = new WorkingDir(Utili.GetCurrentMethodAndClass()))
     {
         DeviceActivationEntryLogger ael = new DeviceActivationEntryLogger(wd.SqlResultLoggingService);
         HouseholdKey          key       = new HouseholdKey("hhkey");
         List <IDataSaverBase> savers    = new List <IDataSaverBase>
         {
             ael
         };
         InputDataLogger idl   = new InputDataLogger(savers.ToArray());
         CalcLoadTypeDto cldto = new CalcLoadTypeDto("loadtype", "kw", "kwh", 1, true, "guid".ToStrGuid());
         TimeStep        ts    = new TimeStep(1, 1, true);
         CalcDeviceDto   cdd   = new CalcDeviceDto("devicename", "device".ToStrGuid(),
                                                   key, OefcDeviceType.Device, "devicecategoryname",
                                                   "additionalname", "deviceguid".ToStrGuid(), "locationguid".ToStrGuid(), "locationname");
         DeviceActivationEntry ae1 = new DeviceActivationEntry("affordancename",
                                                               cldto, 1, "activator", 1, ts, cdd);
         List <IHouseholdKey> aes = new List <IHouseholdKey>
         {
             ae1
         };
         idl.SaveList(aes);
         var res = ael.Read(key);
         var s1  = JsonConvert.SerializeObject(aes, Formatting.Indented);
         var s2  = JsonConvert.SerializeObject(res, Formatting.Indented);
         s1.Should().Be(s2);
         wd.CleanUp();
     }
 }