public void Send_Where_MessageDoesntHaveCallbackRegistered_Expect_CallbackNotInvoked() { ExecutionStatusCallbackDispatcher _executionStatusCallbackDispatcher = new ExecutionStatusCallbackDispatcher(); bool expected = false; bool actual = false; Guid guid = Guid.NewGuid(); Action <ExecutionStatusCallbackMessage> callback = new Action <ExecutionStatusCallbackMessage>(m => { actual = true; }); ExecutionStatusCallbackMessage message = new ExecutionStatusCallbackMessage(Guid.NewGuid(), ExecutionStatusCallbackMessageType.Unknown); _executionStatusCallbackDispatcher.Add(guid, callback); _executionStatusCallbackDispatcher.Send(message); Assert.AreEqual(expected, actual); }
public void Send_Where_MessageIsNull_Expect_ArgumentNullException() { ExecutionStatusCallbackDispatcher _executionStatusCallbackDispatcher = new ExecutionStatusCallbackDispatcher(); _executionStatusCallbackDispatcher.Send(null); }