public void When_There_Is_No_Message_In_The_Sql_Message_Store()
        {
            _storedMessage = _sqlMessageStore.Get(_messageEarliest.Id);

            //_should_return_a_empty_message
            _storedMessage.Header.MessageType.Should().Be(MessageType.MT_NONE);
        }
Пример #2
0
        public void When_There_Is_No_Message_In_The_Sql_Message_Store()
        {
            _storedMessage = _SqlMessageStore.Get(_messageEarliest.Id);

            //_should_return_a_empty_message
            Assert.AreEqual(MessageType.MT_NONE, _storedMessage.Header.MessageType);
        }
Пример #3
0
        public void When_There_Are_Multiple_Messages_In_The_Message_Store_And_A_Range_Is_Fetched()
        {
            messages = _sSqlMessageStore.Get(1, 3);

            //_should_fetch_1_message
            Assert.AreEqual(1, messages.Count());
            //_should_fetch_expected_message
            Assert.AreEqual(_TopicLastMessage, messages.First().Header.Topic);
            //_should_not_fetch_null_messages
            Assert.NotNull(messages);
        }
        public void When_Writing_Messages_To_The_Message_Store()
        {
            _retrievedMessages = _sSqlMessageStore.Get();

            // _should_read_first_message_last_from_the__message_store
            Assert.AreEqual(_messageEarliest.Id, _retrievedMessages.Last().Id);
            //_should_read_last_message_first_from_the__message_store
            Assert.AreEqual(_messageLatest.Id, _retrievedMessages.First().Id);
            //_should_read_the_messages_from_the__message_store
            Assert.AreEqual(3, _retrievedMessages.Count());
        }
Пример #5
0
        public void When_There_Are_Multiple_Messages_In_The_Message_Store_And_A_Range_Is_Fetched()
        {
            messages = _sSqlMessageStore.Get(1, 3);

            //_should_fetch_1_message
            messages.Should().HaveCount(1);
            //_should_fetch_expected_message
            messages.First().Header.Topic.Should().Be(_TopicLastMessage);
            //_should_not_fetch_null_messages
            messages.Should().NotBeNull();
        }
        public void When_Writing_Messages_To_The_Message_Store()
        {
            _retrievedMessages = _sqlMessageStore.Get();

            // _should_read_first_message_last_from_the__message_store
            _retrievedMessages.Last().Id.Should().Be(_messageEarliest.Id);
            //_should_read_last_message_first_from_the__message_store
            _retrievedMessages.First().Id.Should().Be(_messageLatest.Id);
            //_should_read_the_messages_from_the__message_store
            _retrievedMessages.Should().HaveCount(3);
        }
Пример #7
0
        public void When_writing_a_message_with_minimal_header_information_to_the_message_store()
        {
            _storedMessage = _sqlMessageStore.Get(_message.Id);

            //_should_read_the_message_from_the__sql_message_store
            Assert.AreEqual(_message.Body.Value, _storedMessage.Body.Value);
            //_should_read_the_message_header_type_from_the__sql_message_store
            Assert.AreEqual(_message.Header.MessageType, _storedMessage.Header.MessageType);
            //_should_read_the_message_header_topic_from_the__sql_message_store
            Assert.AreEqual(_message.Header.Topic, _storedMessage.Header.Topic);
            //_should_default_the_timestamp_from_the__sql_message_store
            Assert.GreaterOrEqual(_storedMessage.Header.TimeStamp, _message.Header.TimeStamp);
            //_should_read_empty_header_bag_from_the__sql_message_store
            Assert.False(_storedMessage.Header.Bag.Keys.Any());
        }
Пример #8
0
        public void When_writing_a_message_with_minimal_header_information_to_the_message_store()
        {
            _storedMessage = _sqlMessageStore.Get(_message.Id);

            //_should_read_the_message_from_the__sql_message_store
            _storedMessage.Body.Value.Should().Be(_message.Body.Value);
            //_should_read_the_message_header_type_from_the__sql_message_store
            _storedMessage.Header.MessageType.Should().Be(_message.Header.MessageType);
            //_should_read_the_message_header_topic_from_the__sql_message_store
            _storedMessage.Header.Topic.Should().Be(_message.Header.Topic);
            //_should_default_the_timestamp_from_the__sql_message_store
            _storedMessage.Header.TimeStamp.Should().BeOnOrAfter(_message.Header.TimeStamp);
            //_should_read_empty_header_bag_from_the__sql_message_store
            _storedMessage.Header.Bag.Keys.Should().BeEmpty();
        }
Пример #9
0
        public void When_Writing_A_Message_To_The_Message_Store()
        {
            _storedMessage = _SqlMessageStore.Get(_messageEarliest.Id);

            //_should_read_the_message_from_the__sql_message_store
            Assert.AreEqual(_messageEarliest.Body.Value, _storedMessage.Body.Value);
            //_should_read_the_message_header_first_bag_item_from_the__sql_message_store
            Assert.True(_storedMessage.Header.Bag.ContainsKey(key1));
            Assert.AreEqual(value1, _storedMessage.Header.Bag[key1]);
            //_should_read_the_message_header_second_bag_item_from_the__sql_message_store
            Assert.True(_storedMessage.Header.Bag.ContainsKey(key2));
            Assert.AreEqual(value2, _storedMessage.Header.Bag[key2]);
            //_should_read_the_message_header_timestamp_from_the__sql_message_store
            Assert.AreEqual(_messageEarliest.Header.TimeStamp, _storedMessage.Header.TimeStamp);
            //_should_read_the_message_header_topic_from_the__sql_message_store
            Assert.AreEqual(_messageEarliest.Header.Topic, _storedMessage.Header.Topic);
            //_should_read_the_message_header_type_from_the__sql_message_store
            Assert.AreEqual(_messageEarliest.Header.MessageType, _storedMessage.Header.MessageType);
        }
Пример #10
0
        public void When_Writing_A_Message_To_The_Message_Store()
        {
            _storedMessage = _sqlMessageStore.Get(_messageEarliest.Id);

            //_should_read_the_message_from_the__sql_message_store
            _storedMessage.Body.Value.Should().Be(_messageEarliest.Body.Value);
            //_should_read_the_message_header_first_bag_item_from_the__sql_message_store
            _storedMessage.Header.Bag.ContainsKey(key1).Should().BeTrue();
            _storedMessage.Header.Bag[key1].Should().Be(value1);
            //_should_read_the_message_header_second_bag_item_from_the__sql_message_store
            _storedMessage.Header.Bag.ContainsKey(key2).Should().BeTrue();
            _storedMessage.Header.Bag[key2].Should().Be(value2);
            //_should_read_the_message_header_timestamp_from_the__sql_message_store
            _storedMessage.Header.TimeStamp.Should().Be(_messageEarliest.Header.TimeStamp);
            //_should_read_the_message_header_topic_from_the__sql_message_store
            _storedMessage.Header.Topic.Should().Be(_messageEarliest.Header.Topic);
            //_should_read_the_message_header_type_from_the__sql_message_store
            _storedMessage.Header.MessageType.Should().Be(_messageEarliest.Header.MessageType);
        }