public void ClosingNonDocumentWindowDoesNotSynchronizesDocumentMetadata(
            vsWindowType windowType)
        {
            // Arrange

            var metadataManagerMock = new Mock <IDocumentMetadataManager>();
            var service             = new WindowEventsService(metadataManagerMock.Object);

            var created = new Mock <Window>();

            created.Setup(w => w.Type).Returns(windowType);

            // Act

            service.WindowClosing(created.Object);

            // Assert

            created.Verify(w => w.DTE, Times.Never);

            metadataManagerMock.Verify(m => m.Synchronize(
                                           null,
                                           It.IsAny <bool>()),
                                       Times.Never);

            metadataManagerMock.Verify(m => m.Synchronize(
                                           It.IsAny <Documents>(),
                                           It.IsAny <bool>()),
                                       Times.Never);
        }
        public void NonDocumentWindowActivationDoesNotActivateDocumentMetadata(
            vsWindowType windowType)
        {
            // Arrange

            var metadataManagerMock = new Mock <IDocumentMetadataManager>();
            var service             = new WindowEventsService(metadataManagerMock.Object);

            var gotFocus = new Mock <Window>();

            gotFocus.Setup(w => w.Type).Returns(windowType);

            // Act

            service.WindowActivated(gotFocus.Object, null);

            // Assert

            gotFocus.Verify(w => w.Document, Times.Never);

            metadataManagerMock
            .Verify(m => m.Activate(null),
                    Times.Never);

            metadataManagerMock
            .Verify(m => m.Activate(It.IsAny <string>()),
                    Times.Never);
        }
        public void NonDocumentWindowCreatedDoesNotAddDocument(
            vsWindowType windowType)
        {
            // Arrange

            var metadataManagerMock = new Mock <IDocumentMetadataManager>();
            var service             = new WindowEventsService(metadataManagerMock.Object);

            var created = new Mock <Window>();

            created.Setup(w => w.Type).Returns(windowType);

            // Act

            service.WindowCreated(created.Object);

            // Assert

            created.Verify(w => w.Document, Times.Never);

            metadataManagerMock
            .Verify(m => m.Add(It.IsAny <DocumentMetadataInfo>()),
                    Times.Never);
        }
Example #4
0
 /// <summary>
 /// The set kind.
 /// </summary>
 /// <param name="eKind">
 /// The e kind.
 /// </param>
 /// <exception cref="NotImplementedException">
 /// </exception>
 public void SetKind(vsWindowType eKind)
 {
     throw new NotImplementedException();
 }
Example #5
0
 void Window.SetKind(vsWindowType eKind)
 {
     throw new NotImplementedException();
 }
Example #6
0
 public void SetKind(vsWindowType eKind)
 {
     _window.SetKind(eKind);
 }
 void SelectionEvents_OnChange()
 {
     vsWindowType type = _applicationObject.ActiveWindow.Type;
     // switch (type) { ... }
 }
Example #8
0
 public void SetKind(vsWindowType eKind)
 {
     _window.SetKind(eKind);
 }