Example #1
0
 private void Initialize(string producerId)
 {
     if (!AmqpMessageIdHelper.HasMessageIdPrefix(producerId))
     {
         builder.Append(AmqpMessageIdHelper.NMS_ID_PREFIX);
     }
     builder.Append(producerId).Append("-");
     idPrefixLength = builder.Length;
 }
Example #2
0
        public void TestHasIdPrefixWithLowercaseId()
        {
            string myLowerCaseNonId = "id:something";

            Assert.False(AmqpMessageIdHelper.HasMessageIdPrefix(myLowerCaseNonId), "lowercase 'id:' prefix should not result in identification as having 'ID:' prefix");
        }
Example #3
0
        public void TestHasIdPrefixWithoutPrefix()
        {
            string myNonId = "";

            Assert.False(AmqpMessageIdHelper.HasMessageIdPrefix(myNonId), "string without 'ID:' anywhere should not have been identified as having the prefix");
        }
Example #4
0
        public void TestHasIdPrefixWithNull()
        {
            string nullString = null;

            Assert.False(AmqpMessageIdHelper.HasMessageIdPrefix(nullString), "null string should not result in identification as having the prefix");
        }
Example #5
0
        public void TestHasIdPrefixWithIdButNoColonPrefix()
        {
            string myIdNoColon = "IDsomething";

            Assert.False(AmqpMessageIdHelper.HasMessageIdPrefix(myIdNoColon), "'ID' prefix should not have been identified without trailing colon");
        }
Example #6
0
        public void HasMessageIdPrefix()
        {
            string myId = "ID:something";

            Assert.True(AmqpMessageIdHelper.HasMessageIdPrefix(myId), "'ID:' prefix should have been identified");
        }