Пример #1
0
        public void Dispose_ShouldNoLongerRaiseEvents()
        {
            var selectedFrame = ValidWindowFrame;

            testSubject.Dispose();
            (testSubject as IVsSelectionEvents).OnElementValueChanged((uint)VSConstants.VSSELELEMID.SEID_WindowFrame, "1", selectedFrame);

            CheckEventNotRaised();
        }
        public void Dispose_ShouldNoLongerRaiseEvents()
        {
            var selectedFrame = CreateMockFrame(__WindowFrameTypeFlags.WINDOWFRAMETYPE_Document);

            testSubject.Dispose();
            (testSubject as IVsSelectionEvents).OnElementValueChanged((uint)VSConstants.VSSELELEMID.SEID_WindowFrame, "1", selectedFrame.Object);

            mockEventHandler.Verify(x => x(It.IsAny <DocumentFocusedEventArgs>()), Times.Never);
        }
Пример #3
0
        public void Dispose_ShouldUnregisterFromSelectionEvents()
        {
            uint cookie = 1234;

            monitorSelectionMock.Setup(x => x.AdviseSelectionEvents(It.IsAny <IVsSelectionEvents>(), out cookie));

            testSubject = new ActiveDocumentTracker(serviceProviderMock.Object, textDocumentProviderMock.Object);
            testSubject.Dispose();

            monitorSelectionMock.Verify(x => x.UnadviseSelectionEvents(cookie), Times.Once);
        }