private void SendMessage() { var changedMessage = new ExceptionThrownChangedMessage { Text = LastError }; m_Bus.PublishAsync(changedMessage); }
public void CanExecuteClearErrorCommand_ReturnsTrue_ForExceptionThrownIsNotEmpty() { // Arrange var message = new ExceptionThrownChangedMessage { Text = "Text" }; m_Sut.ExceptionThrownChangedHandler(message); // Act // Assert Assert.True(m_Sut.CanExecuteClearErrorCommand()); }
public void ExceptionThrownChangedHandler_RaisesEventExceptionThrown_WhenCalled() { // Arrange var changed = new TestNotifyPropertyChanged(m_Sut, "ExceptionThrown"); var message = new ExceptionThrownChangedMessage { Text = "Text" }; // Act m_Sut.ExceptionThrownChangedHandler(message); // Assert Assert.True(changed.IsExpectedNotified); }
public void IsClearErrorEnabled_ReturnsTrue_ForExceptionThrownIsNotEmpty() { // Arrange var message = new ExceptionThrownChangedMessage { Text = "Text" }; m_Sut.ExceptionThrownChangedHandler(message); // Act // Assert Assert.True(m_Sut.IsClearErrorEnabled); }
public void ExceptionThrownChangedHandler_SetsStatus_WhenCalled() { // Arrange const string expected = "Text"; var message = new ExceptionThrownChangedMessage { Text = expected }; // Act m_Sut.ExceptionThrownChangedHandler(message); // Assert Assert.AreEqual(expected, m_Sut.ExceptionThrown); }
public void ExceptionThrownChangedHandler_SetsExceptionThrownToEmpty_WhenTextIsNull() { // Arrange var message = new ExceptionThrownChangedMessage { Text = null }; // Act m_Sut.ExceptionThrownChangedHandler(message); // Assert Assert.AreEqual(string.Empty, m_Sut.ExceptionThrown); }
private void UpdateAndNotify(ExceptionThrownChangedMessage message) { ExceptionThrown = message.Text ?? string.Empty; NotifyPropertyChanged("ExceptionThrown"); NotifyPropertyChanged("IsClearErrorEnabled"); m_CommandManager.InvalidateRequerySuggested(); }
internal void ExceptionThrownChangedHandler(ExceptionThrownChangedMessage message) { m_Dispatcher.BeginInvoke(() => UpdateAndNotify(message)); }