public void Default_MruProductMaxCount()
 {
     var settingsToWrite = new Settings();
     var storage = new SettingsBinaryStorage();
     var readSettings = WriteAndRead(storage, settingsToWrite, overrideVersion: 3);
     Assert.AreEqual(10, readSettings.MruProductMaxCount);
 }
 public void Default_MaxBolus()
 {
     var settingsToWrite = new Settings();
     var storage = new SettingsBinaryStorage();
     var readSettings = WriteAndRead(storage, settingsToWrite, overrideVersion: 3);
     Assert.AreEqual(5, readSettings.MaxBolus);
 }
 public void Default_ShowWelcomeScreen()
 {
     #if !DEBUG || NCRUNCH
     var settingsToWrite = new Settings { ShowWelcomeScreen = false };
     var storage = new SettingsBinaryStorage();
     var readSettings = WriteAndRead(storage, settingsToWrite, overrideVersion: 7);
     Assert.IsTrue(readSettings.ShowWelcomeScreen);
     #endif
 }
 public void Default_Cloud()
 {
     var settingsToWrite = new Settings();
     var storage = new SettingsBinaryStorage();
     var readSettings = WriteAndRead(storage, settingsToWrite, overrideVersion: 3);
     Assert.IsEmpty(readSettings.CloudSecret);
     Assert.IsEmpty(readSettings.CloudToken);
     Assert.AreEqual(DateTime.MinValue, readSettings.CloudExportDue);
 }
 public void Default_Culture(string systemCulture, string expectedUiCulture, string expectedProductCulture)
 {
     var thread = Thread.CurrentThread;
     thread.CurrentCulture = new CultureInfo(systemCulture);
     var settingsToWrite = new Settings();
     var storage = new SettingsBinaryStorage();
     var readSettings = WriteAndRead(storage, settingsToWrite, overrideVersion: 2);
     Assert.AreEqual(expectedUiCulture, readSettings.CurrentUiCulture);
     Assert.AreEqual(expectedProductCulture, readSettings.CurrentProductCulture);
 }
 public void Can_Write_And_Read()
 {
     var settingsToWrite = fixture.Create<Settings>();
     settingsToWrite.SugarUnit = SugarUnit.mmolL;
     settingsToWrite.Unit = Unit.Ounce;
     settingsToWrite.ShowWelcomeScreen = false;
     var storage = new SettingsBinaryStorage();
     var readSettings = WriteAndRead(storage, settingsToWrite);
     settingsToWrite.AsSource().OfLikeness<Settings>()
         .Without(settings => settings.MruProductIds)
         .ShouldEqual(readSettings);
     Assert.AreEqual(settingsToWrite.MruProductIds, readSettings.MruProductIds);
 }
 public void Default_SugarsAfterInsulinHours()
 {
     var settingsToWrite = new Settings();
     var storage = new SettingsBinaryStorage();
     var readSettings = WriteAndRead(storage, settingsToWrite, overrideVersion: 3);
     Assert.AreEqual(4, readSettings.SugarsAfterInsulinHours);
 }
 public void Default_Unit(string culture, Unit unit)
 {
     var thread = Thread.CurrentThread;
     thread.CurrentCulture = new CultureInfo(culture);
     var settingsToWrite = new Settings();
     var storage = new SettingsBinaryStorage();
     var readSettings = WriteAndRead(storage, settingsToWrite, overrideVersion: 5);
     Assert.AreEqual(unit, readSettings.Unit);
 }