public void ColonyExceptionThrownHandler_SendsMessage_WhenCalled() { // Arrange const string expected = "Text"; var message = new ColonyExceptionThrownMessage { Text = expected }; // Act m_Sut.ColonyExceptionThrownHandler(message); // Assert m_Bus.Received().PublishAsync(Arg.Is <ExceptionThrownChangedMessage>(x => x.Text == expected)); }
public void ClearExceptionThrownHandler_SetsLastErrorToEmpty_WhenCalled() { // Arrange var message = new ColonyExceptionThrownMessage { Text = "Text" }; m_Sut.ColonyExceptionThrownHandler(message); // Act m_Sut.ClearExceptionThrownHandler(new ExceptionThrownClearErrorMessage()); // Assert Assert.AreEqual(string.Empty, m_Sut.LastError); }
public void ClearError_SendsMessage_WhenCalled() { // Arrange var message = new ColonyExceptionThrownMessage { Text = "Text" }; m_Sut.ColonyExceptionThrownHandler(message); m_Bus.ClearReceivedCalls(); // Act m_Sut.ClearExceptionThrownHandler(new ExceptionThrownClearErrorMessage()); // Assert m_Bus.Received().PublishAsync(Arg.Is <ExceptionThrownChangedMessage>(x => x.Text == string.Empty)); }
public void ColonyExceptionThrownHandler_SetsLastError_WhenCalled() { // Arrange const string expected = "Text"; var message = new ColonyExceptionThrownMessage { Text = expected }; // Act m_Sut.ColonyExceptionThrownHandler(message); // Assert Assert.AreEqual(expected, m_Sut.LastError); }