public void WhenKeyEmpty_ThenDefaultsAreProvided() { var baseKey = hkcu.CreateSubKey(TestKeyPath); var repository = new TerminalSettingsRepository(baseKey); var settings = repository.GetSettings(); Assert.IsTrue(settings.IsCopyPasteUsingCtrlCAndCtrlVEnabled.BoolValue); Assert.IsFalse(settings.IsSelectAllUsingCtrlAEnabled.BoolValue); Assert.IsTrue(settings.IsCopyPasteUsingShiftInsertAndCtrlInsertEnabled.BoolValue); Assert.IsTrue(settings.IsSelectUsingShiftArrrowEnabled.BoolValue); Assert.IsTrue(settings.IsQuoteConvertionOnPasteEnabled.BoolValue); Assert.IsTrue(settings.IsNavigationUsingControlArrrowEnabled.BoolValue); }
public void WhenKeyEmpty_ThenDefaultsAreProvided() { var baseKey = hkcu.CreateSubKey(TestKeyPath); var repository = new TerminalSettingsRepository(baseKey); var settings = repository.GetSettings(); Assert.IsTrue(settings.IsCopyPasteUsingCtrlCAndCtrlVEnabled.BoolValue); Assert.IsFalse(settings.IsSelectAllUsingCtrlAEnabled.BoolValue); Assert.IsTrue(settings.IsCopyPasteUsingShiftInsertAndCtrlInsertEnabled.BoolValue); Assert.IsTrue(settings.IsSelectUsingShiftArrrowEnabled.BoolValue); Assert.IsTrue(settings.IsQuoteConvertionOnPasteEnabled.BoolValue); Assert.IsTrue(settings.IsNavigationUsingControlArrrowEnabled.BoolValue); Assert.IsTrue(settings.IsScrollingUsingCtrlUpDownEnabled.BoolValue); Assert.IsTrue(settings.IsScrollingUsingCtrlHomeEndEnabled.BoolValue); Assert.AreEqual(TerminalFont.DefaultFontFamily, settings.FontFamily.StringValue); Assert.AreEqual(TerminalFont.DefaultSize, TerminalSettings.FontSizeFromDword(settings.FontSizeAsDword.IntValue)); }
public void WhenSettingsChanged_ThenEventIsFired() { var baseKey = hkcu.CreateSubKey(TestKeyPath); var repository = new TerminalSettingsRepository(baseKey); bool eventFired = false; repository.SettingsChanged += (sender, args) => { Assert.AreSame(repository, sender); Assert.IsTrue(args.Data.IsSelectAllUsingCtrlAEnabled.BoolValue); eventFired = true; }; var settings = repository.GetSettings(); Assert.IsFalse(settings.IsSelectAllUsingCtrlAEnabled.BoolValue); settings.IsSelectAllUsingCtrlAEnabled.BoolValue = true; repository.SetSettings(settings); Assert.IsTrue(eventFired); }