public void GivenAConfigFileWithThefollowingMapping(Table table)
        {
            IEnumerable <Guid> prioritized = table.Rows.Select(row => Guid.Parse(row["prioritized"]));
            var prioritizer = new PrioritizerConfiguration(prioritized);
            var file        = JsonConvert.SerializeObject(prioritizer);

            _appContext.AddConfigurationFile("data/configuration.json", file);
        }
Esempio n. 2
0
        public void GivenAConfigFileWithThefollowingMapping(Table table)
        {
            var mappings           = table.Rows.Select(row => (Source: row["Source"], From: row["From"], To: Guid.Parse(row["To"])));
            var identitiesBySource = mappings.GroupBy(row => row.Source);
            var identitiesSource   = identitiesBySource.ToDictionary(entry => entry.Key,
                                                                     entry => entry.ToDictionary(entryForSource => entryForSource.From,
                                                                                                 entryForSource => entryForSource.To)).ToDictionary(entry => entry.Key,
                                                                                                                                                    entry => new TimeSeriesByTag(entry.Value));

            var identities = new Identities(identitiesSource);
            var file       = JsonConvert.SerializeObject(identities);

            _appContext.AddConfigurationFile("data/identities.json", file);
        }