public void When_There_Is_No_Message_In_The_Sql_Command_Store()
        {
            _storedCommand = _mysqlCommandStore.Get <MyCommand>(Guid.NewGuid());

            //_should_return_an_empty_command_on_a_missing_command
            _storedCommand.Id.Should().Be(Guid.Empty);
        }
Beispiel #2
0
        public void When_There_Is_No_Message_In_The_Sql_Command_Store_Get()
        {
            Guid commandId = Guid.NewGuid();
            var  exception = Catch.Exception(() => _mysqlCommandStore.Get <MyCommand>(commandId, _contextKey));

            exception.Should().BeOfType <CommandNotFoundException <MyCommand> >();
        }
Beispiel #3
0
        public void When_The_Message_Is_Already_In_The_Command_Store_Different_Context()
        {
            _mysqlCommandStore.Add(_raisedCommand, "some other key");

            _exception = Catch.Exception(() => _mysqlCommandStore.Get <MyCommand>(_raisedCommand.Id, "some other key"));

            _exception.Should().BeOfType <CommandNotFoundException <MyCommand> >();
        }
Beispiel #4
0
        public async void When_The_Message_Is_Already_In_The_Command_Store_Different_Context()
        {
            await _mysqlCommandStore.AddAsync(_raisedCommand, "some other key");

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

            //_should_read_the_command_from_the__dynamo_db_command_store
            storedCommand.Should().NotBeNull();
        }
Beispiel #5
0
        public void When_There_Is_No_Message_In_The_Sql_Command_Store()
        {
            Guid commandId = Guid.NewGuid();

            _storedCommand = _mysqlCommandStore.Get <MyCommand>(commandId, _contextKey);

            //_should_return_an_empty_command_on_a_missing_command
            _storedCommand.Id.Should().Be(Guid.Empty);
            _mysqlCommandStore.Exists <MyCommand>(commandId, _contextKey).Should().BeFalse();
        }
Beispiel #6
0
        public void When_Writing_A_Message_To_The_Command_Store()
        {
            _storedCommand = _mysqlCommandStore.Get <MyCommand>(_raisedCommand.Id, _contextKey);

            //_should_read_the_command_from_the__sql_command_store
            _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);
        }