Beispiel #1
0
        public void PartitionContextDefaultsLastEnqueuedEventProperties()
        {
            var partition = "0";
            var context   = EventHubsModelFactory.PartitionContext(partition);

            Assert.That(context, Is.Not.Null, "The context should have been created.");
            Assert.That(context.PartitionId, Is.EqualTo(partition), "The context should have been set.");
            Assert.That(context.ReadLastEnqueuedEventProperties(), Is.EqualTo(new LastEnqueuedEventProperties()), "Reading last enqueued event properties should return a default instance.");
        }
Beispiel #2
0
        public void PartitionContextInitializesProperties()
        {
            var fakeDate   = new DateTimeOffset(2015, 10, 27, 12, 0, 0, TimeSpan.Zero);
            var partition  = "0";
            var properties = EventHubsModelFactory.LastEnqueuedEventProperties(465, 988, fakeDate, fakeDate);
            var context    = EventHubsModelFactory.PartitionContext(partition, properties);

            Assert.That(context, Is.Not.Null, "The context should have been created.");
            Assert.That(context.PartitionId, Is.EqualTo(partition), "The context should have been set.");
            Assert.That(context.ReadLastEnqueuedEventProperties(), Is.EqualTo(properties), "The last enqueued event properties should have been set.");
        }
        public void PartitionContextDefaultsLastEnqueuedEventProperties()
        {
            var fullyQualifiedNamespace = "fakeNamespace";
            var eventHubName            = "fakeHub";
            var consumerGroup           = "fakeConsumerGroup";
            var partition = "0";
            var context   = EventHubsModelFactory.PartitionContext(fullyQualifiedNamespace, eventHubName, consumerGroup, partition);

            Assert.That(context, Is.Not.Null, "The context should have been created.");
            Assert.That(context.FullyQualifiedNamespace, Is.EqualTo(fullyQualifiedNamespace), "The namespace should have been set.");
            Assert.That(context.EventHubName, Is.EqualTo(eventHubName), "The event hub name should have been set.");
            Assert.That(context.ConsumerGroup, Is.EqualTo(consumerGroup), "The consumer group should have been set.");
            Assert.That(context.PartitionId, Is.EqualTo(partition), "The partition should have been set.");
            Assert.That(context.ReadLastEnqueuedEventProperties(), Is.EqualTo(new LastEnqueuedEventProperties()), "Reading last enqueued event properties should return a default instance.");
        }
        public void PartitionContextInitializesProperties()
        {
            var fakeDate = new DateTimeOffset(2015, 10, 27, 12, 0, 0, TimeSpan.Zero);
            var fullyQualifiedNamespace = "fakeNamespace";
            var eventHubName            = "fakeHub";
            var consumerGroup           = "fakeConsumerGroup";
            var partition  = "0";
            var properties = EventHubsModelFactory.LastEnqueuedEventProperties(465, 988, fakeDate, fakeDate);
            var context    = EventHubsModelFactory.PartitionContext(fullyQualifiedNamespace, eventHubName, consumerGroup, partition, properties);

            Assert.That(context, Is.Not.Null, "The context should have been created.");
            Assert.That(context.FullyQualifiedNamespace, Is.EqualTo(fullyQualifiedNamespace), "The namespace should have been set.");
            Assert.That(context.EventHubName, Is.EqualTo(eventHubName), "The event hub name should have been set.");
            Assert.That(context.ConsumerGroup, Is.EqualTo(consumerGroup), "The consumer group should have been set.");
            Assert.That(context.PartitionId, Is.EqualTo(partition), "The partition should have been set.");
            Assert.That(context.ReadLastEnqueuedEventProperties(), Is.EqualTo(properties), "The last enqueued event properties should have been set.");
        }