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

            //_should_return_an_empty_command_on_a_missing_command
            Assert.AreEqual(Guid.Empty, _storedCommand.Id);
        }
Exemple #2
0
        public void When_There_Is_No_Message_In_The_Sql_Command_Store_Get()
        {
            Guid commandId = Guid.NewGuid();
            var  exception = Catch.Exception(() => _sqlCommandStore.Get <MyCommand>(commandId, _contextKey));

            exception.Should().BeOfType <CommandNotFoundException <MyCommand> >();
        }
        public void When_There_Is_No_Message_In_The_Sql_Command_Store()
        {
            Guid commandId = Guid.NewGuid();

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

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

            //_should_read_the_command_from_the__sql_command_store
            Assert.NotNull(_storedCommand);
            //_should_read_the_command_value
            Assert.AreEqual(_raisedCommand.Value, _storedCommand.Value);
            //_should_read_the_command_id
            Assert.AreEqual(_raisedCommand.Id, _storedCommand.Id);
        }
        public void When_Writing_A_Message_To_The_Command_Store()
        {
            _storedCommand = _sqlCommandStore.Get <MyCommand>(_raisedCommand.Id);

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