public void When_Writing_A_Message_To_The_Inbox()
        {
            _storedCommand = _pgSqlInbox.Get <MyCommand>(_raisedCommand.Id, _contextKey);

            //_should_read_the_command_from_the__sql_inbox
            AssertionExtensions.Should((object)_storedCommand).NotBeNull();
            //_should_read_the_command_value
            AssertionExtensions.Should((string)_storedCommand.Value).Be(_raisedCommand.Value);
            //_should_read_the_command_id
            AssertionExtensions.Should((Guid)_storedCommand.Id).Be(_raisedCommand.Id);
        }
Esempio n. 2
0
        public void When_There_Is_No_Message_In_The_Sql_Inbox_And_Call_Get()
        {
            Guid commandId = Guid.NewGuid();
            var  exception = Catch.Exception(() => _storedCommand = _pgSqlInbox.Get <MyCommand>(commandId, _contextKey));

            AssertionExtensions.Should((object)exception).BeOfType <RequestNotFoundException <MyCommand> >();
        }
Esempio n. 3
0
        public async void When_The_Message_Is_Already_In_The_Inbox_Different_Context()
        {
            await _pgSqlInbox.AddAsync(_raisedCommand, "some other key");

            var storedCommand = _pgSqlInbox.Get <MyCommand>(_raisedCommand.Id, "some other key");

            //_should_read_the_command_from_the__dynamo_db_inbox
            AssertionExtensions.Should((object)storedCommand).NotBeNull();
        }
        public void When_The_Message_Is_Already_In_The_Inbox_Different_Context()
        {
            _pgSqlInbox.Add(_raisedCommand, _contextKey);

            var newcontext = Guid.NewGuid().ToString();

            _pgSqlInbox.Add(_raisedCommand, newcontext);

            var storedCommand = _pgSqlInbox.Get <MyCommand>(_raisedCommand.Id, newcontext);

            //_should_read_the_command_from_the__dynamo_db_inbox
            AssertionExtensions.Should((object)storedCommand).NotBeNull();
        }