public void ExecuteDoesNotThrowExceptionWithNullParameter() { // Arrange var manager = Mock.Of <IDocumentMetadataManager>(); var command = new ToggleIsPinned(manager); // Act, Assert Assert.DoesNotThrow(() => command.Execute(null)); Mock.Get(manager).Verify(m => m.TogglePinnedStatus(It.IsAny <DocumentMetadata>()), Times.Never); }
public void ExecuteInvokesDocumentMetadataManagerTogglePinnedStatus() { // Arrange var manager = Mock.Of <IDocumentMetadataManager>(); var command = new ToggleIsPinned(manager); var metadata = new DocumentMetadata( new DocumentMetadataInfo(), string.Empty, null); // Act command.Execute(metadata); // Assert Mock.Get(manager).Verify(m => m.TogglePinnedStatus(metadata), Times.Once); }