Beispiel #1
0
        public async Task When_There_Is_No_Message_In_The_Sql_Command_Store_Exists_Async()
        {
            Guid commandId = Guid.NewGuid();
            bool exists    = await _sqlCommandStore.ExistsAsync <MyCommand>(commandId, _contextKey);

            exists.Should().BeFalse();
        }
        public async Task When_The_Message_Is_Already_In_The_Command_Store_Async()
        {
            await _sqlCommandStore.AddAsync(_raisedCommand);

            _exception = await Catch.ExceptionAsync(() => _sqlCommandStore.AddAsync(_raisedCommand));

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

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

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

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

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

            exists.Should().BeFalse();
        }