public void Attach_CalledOnceForMultipleListeners()
        {
            // Arrange
            var manager = new TestEditorSettingsManagerInternal(Dispatcher);

            // Act
            manager.Changed += (caller, args) => { };
            manager.Changed += (caller, args) => { };

            // Assert
            Assert.Equal(1, manager.AttachCount);
        }
コード例 #2
0
        public void Detach_CalledOnceWhenNoMoreListeners()
        {
            // Arrange
            var manager = new TestEditorSettingsManagerInternal(Dispatcher);
            EventHandler <EditorSettingsChangedEventArgs> listener1 = (caller, args) => { };
            EventHandler <EditorSettingsChangedEventArgs> listener2 = (caller, args) => { };

            manager.Changed += listener1;
            manager.Changed += listener2;

            // Act
            manager.Changed -= listener1;
            manager.Changed -= listener2;

            // Assert
            Assert.Equal(1, manager.DetachCount);
        }
 public void Detach_CalledOnceWhenNoMoreListeners()
 {
     // Arrange
     var manager = new TestEditorSettingsManagerInternal(Dispatcher);