コード例 #1
0
        public void When_reading_messages_by_numerical_range()
        {
            var retrievedMessages = _dynamoDbInbox.Get <MyCommand>(_timeStamp, _timeStamp.AddHours(-3), _timeStamp.AddHours(-2));

            //_should_read_the_last_two_messages_from_the_store
            retrievedMessages.Should().HaveCount(1);
            retrievedMessages.Single().Should().BeEquivalentTo(_command2);
        }
コード例 #2
0
        public void When_The_Message_Is_Already_In_The_Inbox_Different_Context()
        {
            _dynamoDbInbox.Add(_raisedCommand, "some other key");

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

            //_should_read_the_command_from_the__dynamo_db_inbox
            AssertionExtensions.Should((object)storedCommand).NotBeNull();
        }
コード例 #3
0
        public void When_writing_a_message_to_the_inbox()
        {
            _storedCommand = _dynamoDbInbox.Get <MyCommand>(_raisedCommand.Id, _contextKey);

            //_should_read_the_command_from_the__dynamo_db_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);
        }
コード例 #4
0
        public void When_writing_a_message_to_the_inbox()
        {
            _storedCommand = _dynamoDbInbox.Get <MyCommand>(_raisedCommand.Id, _contextKey);

            //_should_read_the_command_from_the__dynamo_db_inbox
            _storedCommand.Should().NotBeNull();
            //_should_read_the_command_value
            _storedCommand.Value.Should().Be(_raisedCommand.Value);
            //_should_read_the_command_id
            _storedCommand.Id.Should().Be(_raisedCommand.Id);
        }
コード例 #5
0
        public void When_There_Is_No_Message_In_The_Inbox()
        {
            var exception = Catch.Exception(() => _dynamoDbInbox.Get <MyCommand>(Guid.NewGuid(), "some key"));

            AssertionExtensions.Should((object)exception).BeOfType <RequestNotFoundException <MyCommand> >();
        }