예제 #1
0
        public void WhenDeviceSelected_ThenKeyIsUpdated()
        {
            var settings = this.settingsRepository.GetSettings();

            this.settingsRepository.SetSettings(settings);

            var viewModel = new ScreenOptionsViewModel(
                this.settingsRepository);

            viewModel.Devices.First().IsSelected = true;
            viewModel.ApplyChanges();

            Assert.AreEqual(
                Screen.PrimaryScreen.DeviceName,
                this.settingsRepository.GetSettings().FullScreenDevices.StringValue);
        }
예제 #2
0
        public void WhenAllDevicesDeselected_ThenKeyIsRemoved()
        {
            var settings = this.settingsRepository.GetSettings();

            settings.FullScreenDevices.StringValue = "unknown\\device,and junk";
            this.settingsRepository.SetSettings(settings);

            var viewModel = new ScreenOptionsViewModel(
                this.settingsRepository);

            viewModel.Devices.First().IsSelected = true;
            viewModel.Devices.First().IsSelected = false;
            viewModel.ApplyChanges();

            Assert.IsNull(this.settingsRepository.GetSettings().FullScreenDevices.StringValue);
        }