public async Task Should_be_able_to_update_an_existing_topic_with_new_property_values_without_failing_on_readonly_properties() { var namespaceManager = new NamespaceManagerAdapterInternal(NamespaceManager.CreateFromConnectionString(AzureServiceBusConnectionString.Value), AzureServiceBusConnectionString.Value); await namespaceManager.DeleteTopic("existingtopic2"); await namespaceManager.CreateTopic(new TopicDescription("existingtopic2") { MaxSizeInMegabytes = SizeInMegabytes.Size2048, RequiresDuplicateDetection = true, EnablePartitioning = true }); var topicDescription = await namespaceManager.GetTopic("existingtopic2"); // partitioned topics will have a size that is 16x the requested max Assert.AreEqual(2048 * 16, topicDescription.MaxSizeInMegabytes); Assert.IsTrue(topicDescription.EnablePartitioning); Assert.IsTrue(topicDescription.RequiresDuplicateDetection); var topologyTopicSettings = new TopologyTopicSettings { MaxSizeInMegabytes = SizeInMegabytes.Size3072, RequiresDuplicateDetection = false, EnablePartitioning = false }; var creator = new AzureServiceBusTopicCreator(topologyTopicSettings); await creator.Create("existingtopic2", namespaceManager); topicDescription = await namespaceManager.GetTopic("existingtopic2"); Assert.AreEqual(3072 * 16, topicDescription.MaxSizeInMegabytes); Assert.IsTrue(topicDescription.EnablePartitioning); Assert.IsTrue(topicDescription.RequiresDuplicateDetection); }
public async Task Should_set_SupportOrdering_on_created_entity() { var topologyTopicSettings = new TopologyTopicSettings { SupportOrdering = true }; var creator = new AzureServiceBusTopicCreator(topologyTopicSettings); const string topicPath = "mytopic12"; var namespaceManager = new NamespaceManagerAdapterInternal(NamespaceManager.CreateFromConnectionString(AzureServiceBusConnectionString.Value), AzureServiceBusConnectionString.Value); await namespaceManager.DeleteTopic(topicPath); await creator.Create(topicPath, namespaceManager); var foundTopic = await namespaceManager.GetTopic(topicPath); Assert.IsTrue(foundTopic.SupportOrdering); }
public async Task Should_set_MaxSizeInMegabytes_on_created_entity() { var topologyTopicSettings = new TopologyTopicSettings { MaxSizeInMegabytes = SizeInMegabytes.Size4096 }; var creator = new AzureServiceBusTopicCreator(topologyTopicSettings); const string topicPath = "mytopic10"; var namespaceManager = new NamespaceManagerAdapterInternal(NamespaceManager.CreateFromConnectionString(AzureServiceBusConnectionString.Value), AzureServiceBusConnectionString.Value); await namespaceManager.DeleteTopic(topicPath); await creator.Create(topicPath, namespaceManager); var foundTopic = await namespaceManager.GetTopic(topicPath); Assert.AreEqual(4096, foundTopic.MaxSizeInMegabytes); }
public async Task Should_set_EnableBatchedOperations_on_created_entity() { var topologyTopicSettings = new TopologyTopicSettings { EnableBatchedOperations = false }; var creator = new AzureServiceBusTopicCreator(topologyTopicSettings); const string topicPath = "mytopic7"; var namespaceManager = new NamespaceManagerAdapterInternal(NamespaceManager.CreateFromConnectionString(AzureServiceBusConnectionString.Value), AzureServiceBusConnectionString.Value); await namespaceManager.DeleteTopic(topicPath); await creator.Create(topicPath, namespaceManager); var foundTopic = await namespaceManager.GetTopic(topicPath); Assert.IsFalse(foundTopic.EnableBatchedOperations); }
public async Task Should_set_DefaultMessageTimeToLive_on_the_created_entity() { var timeToLive = TimeSpan.FromDays(1); var topologyTopicSettings = new TopologyTopicSettings { DefaultMessageTimeToLive = timeToLive }; var creator = new AzureServiceBusTopicCreator(topologyTopicSettings); const string topicPath = "mytopic5"; var namespaceManager = new NamespaceManagerAdapterInternal(NamespaceManager.CreateFromConnectionString(AzureServiceBusConnectionString.Value), AzureServiceBusConnectionString.Value); await namespaceManager.DeleteTopic(topicPath); await creator.Create(topicPath, namespaceManager); var foundTopic = await namespaceManager.GetTopic(topicPath); Assert.AreEqual(timeToLive, foundTopic.DefaultMessageTimeToLive); }
public async Task Should_be_able_to_update_an_existing_topic_with_new_property_values() { var namespaceManager = new NamespaceManagerAdapterInternal(NamespaceManager.CreateFromConnectionString(AzureServiceBusConnectionString.Value), AzureServiceBusConnectionString.Value); await namespaceManager.DeleteTopic("existingtopic1"); await namespaceManager.CreateTopic(new TopicDescription("existingtopic1")); var topologyTopicSettings = new TopologyTopicSettings { AutoDeleteOnIdle = TimeSpan.FromMinutes(100), DefaultMessageTimeToLive = TimeSpan.FromMinutes(5) }; var creator = new AzureServiceBusTopicCreator(topologyTopicSettings); await creator.Create("existingtopic1", namespaceManager); var topicDescription = await namespaceManager.GetTopic("existingtopic1"); Assert.AreEqual(TimeSpan.FromMinutes(100), topicDescription.AutoDeleteOnIdle); }
public async Task Should_set_DuplicateDetectionHistoryTimeWindow_on_created_entity() { var duplicateDetectionTime = TimeSpan.FromDays(1); var topologyTopicSettings = new TopologyTopicSettings { DuplicateDetectionHistoryTimeWindow = duplicateDetectionTime }; var creator = new AzureServiceBusTopicCreator(topologyTopicSettings); const string topicPath = "mytopic6"; var namespaceManager = new NamespaceManagerAdapterInternal(NamespaceManager.CreateFromConnectionString(AzureServiceBusConnectionString.Value), AzureServiceBusConnectionString.Value); await namespaceManager.DeleteTopic(topicPath); await creator.Create(topicPath, namespaceManager); var foundTopic = await namespaceManager.GetTopic(topicPath); Assert.AreEqual(duplicateDetectionTime, foundTopic.DuplicateDetectionHistoryTimeWindow); }
public async Task Should_set_AutoDeleteOnIdle_on_the_created_entity() { var autoDeleteTime = TimeSpan.FromDays(1); var topologyTopicSettings = new TopologyTopicSettings { AutoDeleteOnIdle = autoDeleteTime }; var creator = new AzureServiceBusTopicCreator(topologyTopicSettings); const string topicPath = "mytopic4"; var namespaceManager = new NamespaceManagerAdapterInternal(NamespaceManager.CreateFromConnectionString(AzureServiceBusConnectionString.Value)); await namespaceManager.DeleteTopic(topicPath); await creator.Create(topicPath, namespaceManager); var foundTopic = await namespaceManager.GetTopic(topicPath); Assert.AreEqual(autoDeleteTime, foundTopic.AutoDeleteOnIdle); }
public async Task Should_set_EnablePartitioning_on_created_entity() { var namespaceManager = new NamespaceManagerAdapterInternal(NamespaceManager.CreateFromConnectionString(AzureServiceBusConnectionString.Value)); const string topicPath = "mytopic9"; //clean up before test starts await namespaceManager.DeleteTopic(topicPath); var topologyTopicSettings = new TopologyTopicSettings { EnablePartitioning = true }; var creator = new AzureServiceBusTopicCreator(topologyTopicSettings); await creator.Create(topicPath, namespaceManager); var foundTopic = await namespaceManager.GetTopic(topicPath); Assert.IsTrue(foundTopic.EnablePartitioning); }
public async Task Should_set_correct_defaults() { var creator = new AzureServiceBusTopicCreator(new TopologyTopicSettings()); const string topicPath = "mytopic13"; var namespaceManager = new NamespaceManagerAdapterInternal(NamespaceManager.CreateFromConnectionString(AzureServiceBusConnectionString.Value), AzureServiceBusConnectionString.Value); await namespaceManager.DeleteTopic(topicPath); await creator.Create(topicPath, namespaceManager); var foundTopic = await namespaceManager.GetTopic(topicPath); Assert.AreEqual(TimeSpan.MaxValue, foundTopic.AutoDeleteOnIdle); Assert.AreEqual(TimeSpan.MaxValue, foundTopic.DefaultMessageTimeToLive); Assert.AreEqual(TimeSpan.FromMinutes(10), foundTopic.DuplicateDetectionHistoryTimeWindow); Assert.IsTrue(foundTopic.EnableBatchedOperations); Assert.IsFalse(foundTopic.EnableExpress); Assert.IsFalse(foundTopic.EnableFilteringMessagesBeforePublishing); Assert.IsFalse(foundTopic.EnablePartitioning); Assert.AreEqual((long)SizeInMegabytes.Size1024, foundTopic.MaxSizeInMegabytes); Assert.IsFalse(foundTopic.RequiresDuplicateDetection); Assert.IsFalse(foundTopic.SupportOrdering); }