public void WhenWindowContentImplementsIInteractionRequestAware_ShouldSetUpProperties() { MockInteractionRequestAwareElement element = new MockInteractionRequestAwareElement(); TestablePopupWindowAction popupWindowAction = new TestablePopupWindowAction(); popupWindowAction.WindowContent = element; INotification notification = new Notification(); notification.Title = "Title"; notification.Content = "Content"; Window window = popupWindowAction.GetWindow(notification); Assert.NotNull(element.Notification); Assert.Same(element.Notification, notification); Assert.NotNull(element.FinishInteraction); }
public void WhenDataContextOfWindowContentImplementsIInteractionRequestAware_ShouldSetUpProperties() { MockInteractionRequestAwareElement dataContext = new MockInteractionRequestAwareElement(); MockFrameworkElement element = new MockFrameworkElement(); TestablePopupWindowAction popupWindowAction = new TestablePopupWindowAction(); element.DataContext = dataContext; popupWindowAction.WindowContent = element; INotification notification = new Notification(); notification.Title = "Title"; notification.Content = "Content"; Window window = popupWindowAction.GetWindow(notification); Assert.IsNotNull(dataContext.Notification); Assert.ReferenceEquals(dataContext.Notification, notification); Assert.IsNotNull(dataContext.FinishInteraction); }