public void OnNotificationMessageChanged_WhenHasValue_SetShowNotificationToTrue() { var connectorThumb = new ConnectorThumb(); var privateAccessor = new PrivateAccessor(connectorThumb); privateAccessor.SetProperty("NotificationMessage", "some text"); Assert.IsTrue(connectorThumb.ShowNotification); }
public void OnShowNotificationChanged_WhenTrue_RevertToFalseIfNotificationMessageEmpty() { var connectorThumb = new ConnectorThumb(); connectorThumb.ShowNotification = true; Assert.IsFalse(connectorThumb.ShowNotification); }
public void OnShowNotificationChanged_WhenFalse_ClearNotificationMessage() { var connectorThumb = new ConnectorThumb(); var privateAccessor = new PrivateAccessor(connectorThumb); Mock.NonPublic.Arrange(connectorThumb, "OnNotificationMessageChanged", ArgExpr.IsAny<DependencyObject>(), ArgExpr.IsAny<DependencyPropertyChangedEventArgs>()) .DoNothing(); privateAccessor.SetProperty("NotificationMessage", "some text"); connectorThumb.ShowNotification = true; connectorThumb.ShowNotification = false; Assert.IsNull(connectorThumb.NotificationMessage); }