Exemplo n.º 1
0
        public void OnNotificationMessageChanged_WhenHasValue_SetShowNotificationToTrue()
        {
            var connectorThumb = new ConnectorThumb();
            var privateAccessor = new PrivateAccessor(connectorThumb);

            privateAccessor.SetProperty("NotificationMessage", "some text");
            Assert.IsTrue(connectorThumb.ShowNotification);
        }
Exemplo n.º 2
0
        public void OnShowNotificationChanged_WhenTrue_RevertToFalseIfNotificationMessageEmpty()
        {
            var connectorThumb = new ConnectorThumb();

            connectorThumb.ShowNotification = true;
            Assert.IsFalse(connectorThumb.ShowNotification);
        }
Exemplo n.º 3
0
        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);
        }