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();
        }
예제 #2
0
        public async Task When_The_Message_Is_Already_In_The_Command_Store_Async()
        {
            await _sqlCommandStore.AddAsync(_raisedCommand, _contextKey);

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

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

            exists.Should().BeTrue();
        }
예제 #3
0
        public void When_The_Message_Is_Already_In_The_Command_Store_Async()
        {
            _exception = Catch.Exception(() => AsyncContext.Run(async() => await _sqlCommandStore.AddAsync(_raisedCommand)));

            //_should_succeed_even_if_the_message_is_a_duplicate
            Assert.Null(_exception);
        }
예제 #4
0
        public void Establish()
        {
            _sqliteTestHelper = new SqliteTestHelper();
            _sqliteConnection = _sqliteTestHelper.SetupCommandDb();

            _sqlCommandStore = new SqliteCommandStore(new SqliteCommandStoreConfiguration(_sqliteTestHelper.ConnectionString, _sqliteTestHelper.TableName));
            _raisedCommand   = new MyCommand {
                Value = "Test"
            };
            AsyncContext.Run(async() => await _sqlCommandStore.AddAsync(_raisedCommand));
        }
예제 #5
0
        public async Task When_Writing_A_Message_To_The_Command_Store_Async()
        {
            await _sqlCommandStore.AddAsync(_raisedCommand, _contextKey);

            _storedCommand = await _sqlCommandStore.GetAsync <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);
        }