private void Initialize(string producerId) { if (!AmqpMessageIdHelper.HasMessageIdPrefix(producerId)) { builder.Append(AmqpMessageIdHelper.NMS_ID_PREFIX); } builder.Append(producerId).Append("-"); idPrefixLength = builder.Length; }
public void TestHasIdPrefixWithLowercaseId() { string myLowerCaseNonId = "id:something"; Assert.False(AmqpMessageIdHelper.HasMessageIdPrefix(myLowerCaseNonId), "lowercase 'id:' prefix should not result in identification as having 'ID:' prefix"); }
public void TestHasIdPrefixWithoutPrefix() { string myNonId = ""; Assert.False(AmqpMessageIdHelper.HasMessageIdPrefix(myNonId), "string without 'ID:' anywhere should not have been identified as having the prefix"); }
public void TestHasIdPrefixWithNull() { string nullString = null; Assert.False(AmqpMessageIdHelper.HasMessageIdPrefix(nullString), "null string should not result in identification as having the prefix"); }
public void TestHasIdPrefixWithIdButNoColonPrefix() { string myIdNoColon = "IDsomething"; Assert.False(AmqpMessageIdHelper.HasMessageIdPrefix(myIdNoColon), "'ID' prefix should not have been identified without trailing colon"); }
public void HasMessageIdPrefix() { string myId = "ID:something"; Assert.True(AmqpMessageIdHelper.HasMessageIdPrefix(myId), "'ID:' prefix should have been identified"); }