namespace Cthangover.Mods.Stats.Tests { using System; using System.Collections.Generic; using Cthangover.Mods.Stats.Formulas; /// A formula scope over a plain dictionary and a seeded generator, for the tests. public class TestScope : IFormulaScope { private readonly Dictionary values; public TestScope(Dictionary values, int seed = 7) { this.values = new Dictionary(values ?? new Dictionary(), StringComparer.OrdinalIgnoreCase); Random = new Random(seed); } public bool TryGet(string name, out double value) => values.TryGetValue(name, out value); public Random Random { get; } } }