Ejemplo n.º 1
0
        public void GetDuplicateCalcManagerHouseholdTest()
        {
            using (var wd1 = new WorkingDir("GetDuplicateCalcManagerHouseholdTest1"))
            {
                CalculateOneHousehold(wd1.WorkingDirectory);
                using (var wd2 = new WorkingDir("GetDuplicateCalcManagerHouseholdTest2"))
                {
                    CalculateOneHousehold(wd2.WorkingDirectory);

                    var hhkeys   = HouseholdKeyLogger.Load(wd1.SqlResultLoggingService);
                    var afts1    = new CalcDeviceDtoLogger(wd1.SqlResultLoggingService);
                    var aft1     = afts1.Load(hhkeys.Where(x => x.KeyType == HouseholdKeyType.Household).ToList());
                    var afts2    = new CalcDeviceDtoLogger(wd2.SqlResultLoggingService);
                    var aft2     = afts2.Load(hhkeys.Where(x => x.KeyType == HouseholdKeyType.Household).ToList());
                    var devices1 = aft1.Select(x => x.Name).OrderBy(x => x).ToList();
                    var devices2 = aft2.Select(x => x.Name).OrderBy(x => x).ToList();
                    devices1.Should().BeEquivalentTo(devices2);

                    var rfel1 = new ResultFileEntryLogger(wd1.SqlResultLoggingService);
                    var rfes1 = rfel1.Load();
                    var rfel2 = new ResultFileEntryLogger(wd2.SqlResultLoggingService);
                    var rfes2 = rfel2.Load();
                    rfes1.Should().BeEquivalentTo(rfes2, o => o.Excluding(
                                                      x => x.SelectedMemberPath.EndsWith("FullFileName", StringComparison.InvariantCultureIgnoreCase)));

                    CompareCsv(rfes1, rfes2);
                    wd1.CleanUp();
                    wd2.CleanUp();
                }
            }
        }
 public List<CalcDeviceDto> LoadDevices([NotNull] HouseholdKey key)
 {
     CalcDeviceDtoLogger cpl = new CalcDeviceDtoLogger(_srls);
     return cpl.Load(key);
 }