public LogicTest() { _store = new TestStore(); _settings = new ConfigurationBuilder <IFixtureSettings>() .UseConfigStore(_store) .Build(); }
public DefaultValuesTest() { var store = new TestStore(); _settings = new ConfigurationBuilder <IFixtureSettings>() .UseConfigStore(store) .Build(); }
public void Read_cached_integer() { _store.Map["NumberOfMinutes"] = "78"; _settings = new ConfigurationBuilder <IFixtureSettings>() .UseConfigStore(_store) .CacheFor(TimeSpan.FromMinutes(1)) .Build(); Assert.Equal(78, _settings.NumberOfMinutes); _store.Map["NumberOfMinutes"] = "79"; Assert.Equal(78, _settings.NumberOfMinutes); //still cached }
public void Read_Cached_Decimal() { _store.Map["TotalSeconds28d"] = "78"; _settings = new ConfigurationBuilder <IFixtureSettings>() .UseConfigStore(_store) .CacheFor(TimeSpan.FromMinutes(1)) .Build(); Assert.Equal <decimal>(78, _settings.TotalSeconds28d); _store.Map["TotalSeconds28d"] = "79"; Assert.Equal <decimal>(78, _settings.TotalSeconds28d); //still cached }
public void Read_Cached_ULong() { _store.Map["MicroSecondsOfDay"] = "78"; _settings = new ConfigurationBuilder <IFixtureSettings>() .UseConfigStore(_store) .CacheFor(TimeSpan.FromMinutes(1)) .Build(); Assert.Equal <ulong>(78, _settings.MicroSecondsOfDay); _store.Map["MicroSecondsOfDay"] = "79"; Assert.Equal <ulong>(78, _settings.MicroSecondsOfDay); //still cached }
public void Read_Cached_Byte() { _store.Map["HoursOfDay"] = "78"; _settings = new ConfigurationBuilder <IFixtureSettings>() .UseConfigStore(_store) .CacheFor(TimeSpan.FromMinutes(1)) .Build(); Assert.Equal <byte>(78, _settings.HoursOfDay); _store.Map["HoursOfDay"] = "79"; Assert.Equal <byte>(78, _settings.HoursOfDay); //still cached }