Ejemplo n.º 1
0
 private void Initialize(string producerId)
 {
     if (!AmqpMessageIdHelper.HasMessageIdPrefix(producerId))
     {
         builder.Append(AmqpMessageIdHelper.NMS_ID_PREFIX);
     }
     builder.Append(producerId).Append("-");
     idPrefixLength = builder.Length;
 }
Ejemplo n.º 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");
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 4
0
        public void TestHasIdPrefixWithNull()
        {
            string nullString = null;

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

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

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