Inheritance: IExecutionStatusCallbackDispatcher, IDisposable
        public void Add_Where_CallbackIsNull_Expect_ArgumentNullException()
        {
            ExecutionStatusCallbackDispatcher _executionStatusCallbackDispatcher = new ExecutionStatusCallbackDispatcher();

            Guid guid = Guid.NewGuid();

            _executionStatusCallbackDispatcher.Add(guid, null);
        }
        public void Add_Where_CallbackIsNull_Expect_ArgumentNullException()
        {
            ExecutionStatusCallbackDispatcher _executionStatusCallbackDispatcher = new ExecutionStatusCallbackDispatcher();

            Guid guid = Guid.NewGuid();
            Action<ExecutionStatusCallbackMessage> callback = null;

            _executionStatusCallbackDispatcher.Add(guid, callback);
        }
        public void Remove_Where_ItemsDoesntExist_Expect_False()
        {
            ExecutionStatusCallbackDispatcher _executionStatusCallbackDispatcher = new ExecutionStatusCallbackDispatcher();

            Guid guid = Guid.NewGuid();

            bool expected = false;
            bool actual = _executionStatusCallbackDispatcher.Remove(guid);

            Assert.AreEqual(expected, actual);
        }
        public void Add_Where_ItemsDoesntExist_Expect_True()
        {
            ExecutionStatusCallbackDispatcher _executionStatusCallbackDispatcher = new ExecutionStatusCallbackDispatcher();

            Guid guid = Guid.NewGuid();
            Action<ExecutionStatusCallbackMessage> callback = m => { };
            
            bool expected = true;
            bool actual = _executionStatusCallbackDispatcher.Add(guid, callback);

            Assert.AreEqual(expected, actual);
        }
        public void Add_Where_ItemsExists_Expect_False()
        {
            ExecutionStatusCallbackDispatcher _executionStatusCallbackDispatcher = new ExecutionStatusCallbackDispatcher();

            Guid guid = Guid.NewGuid();
            Action<ExecutionStatusCallbackMessage> callback = m => { };
            _executionStatusCallbackDispatcher.Add(guid, callback);

            const bool expected = false;
            bool actual = _executionStatusCallbackDispatcher.Add(guid, callback);

            Assert.AreEqual(expected, actual);
        }
        public void Send_Where_MessageDoesntHaveCallbackRegistered_Expect_CallbackNotInvoked()
        {
            ExecutionStatusCallbackDispatcher _executionStatusCallbackDispatcher = new ExecutionStatusCallbackDispatcher();

            bool expected = false;
            bool actual = false;

            Guid guid = Guid.NewGuid();
            Action<ExecutionStatusCallbackMessage> callback = m => { actual = true; };
            ExecutionStatusCallbackMessage message = new ExecutionStatusCallbackMessage(Guid.NewGuid(), ExecutionStatusCallbackMessageType.Unknown);

            _executionStatusCallbackDispatcher.Add(guid, callback);
            _executionStatusCallbackDispatcher.Send(message);

            Assert.AreEqual(expected, actual);
        }
 public void Post_Where_MessageIsNull_Expect_ArgumentNullException()
 {
     ExecutionStatusCallbackDispatcher _executionStatusCallbackDispatcher = new ExecutionStatusCallbackDispatcher();
     _executionStatusCallbackDispatcher.Post(null);
 }