public async Task When_There_Is_No_Message_In_The_Sql_Command_Store_Exists_Async()
        {
            Guid commandId = Guid.NewGuid();
            bool exists    = await _mysqlCommandStore.ExistsAsync <MyCommand>(commandId, _contextKey);

            exists.Should().BeFalse();
        }
示例#2
0
        public async Task When_The_Message_Is_Already_In_The_Command_Store_Async()
        {
            await _mysqlCommandStore.AddAsync(_raisedCommand, _contextKey);

            _exception = await Catch.ExceptionAsync(() => _mysqlCommandStore.AddAsync(_raisedCommand, _contextKey));

            //_should_succeed_even_if_the_message_is_a_duplicate
            _exception.Should().BeNull();
            var exists = await _mysqlCommandStore.ExistsAsync <MyCommand>(_raisedCommand.Id, _contextKey);

            exists.Should().BeTrue();
        }
示例#3
0
        public async Task When_There_Is_No_Message_In_The_Sql_Command_Store_Async()
        {
            Guid commandId = Guid.NewGuid();

            _storedCommand = await _mysqlCommandStore.GetAsync <MyCommand>(commandId);

            //_should_return_an_empty_command_on_a_missing_command
            _storedCommand.Id.Should().Be(Guid.Empty);

            bool exists = await _mysqlCommandStore.ExistsAsync <MyCommand>(commandId);

            exists.Should().BeFalse();
        }