예제 #1
0
        public void InitialSettingsAreDefault()
        {
            // Act
            var manager = new DefaultEditorSettingsManager(EditorSettingsChangeTriggers);

            // Assert
            Assert.Equal(EditorSettings.Default, manager.Current);
        }
        public void InitialSettingsAreDefault()
        {
            // Act
            var manager = new DefaultEditorSettingsManager(Dispatcher);

            // Assert
            Assert.Equal(EditorSettings.Default, manager.Current);
        }
예제 #3
0
        public void ChangeTriggersGetInitialized()
        {
            // Act
            var triggers = new TestChangeTrigger[]
            {
                new TestChangeTrigger(),
                new TestChangeTrigger(),
            };
            var manager = new DefaultEditorSettingsManager(triggers);

            // Assert
            Assert.All(triggers, (trigger) => Assert.True(trigger.Initialized));
        }
        public void Update_DoesNotTriggerChangedIfEditorSettingsAreSame()
        {
            // Arrange
            var manager = new DefaultEditorSettingsManager(Dispatcher);
            var called  = false;

            manager.Changed += (caller, args) => called = true;
            var originalSettings = manager.Current;

            // Act
            manager.Update(EditorSettings.Default);

            // Assert
            Assert.False(called);
            Assert.Same(originalSettings, manager.Current);
        }
        public void Update_TriggersChangedIfEditorSettingsAreDifferent()
        {
            // Arrange
            var manager = new DefaultEditorSettingsManager(Dispatcher);
            var called  = false;

            manager.Changed += (caller, args) => called = true;
            var settings = new EditorSettings(indentWithTabs: true, indentSize: 7);

            // Act
            manager.Update(settings);

            // Assert
            Assert.True(called);
            Assert.Equal(settings, manager.Current);
        }