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 LastEnqueuedEventPropertiesInitializesProperties() { var lastSequence = long.MaxValue - 100; var lastOffset = long.MaxValue - 10; var lastEnqueued = new DateTimeOffset(2015, 10, 27, 12, 0, 0, TimeSpan.Zero); var lastReceived = new DateTimeOffset(2012, 03, 04, 08, 0, 0, TimeSpan.Zero); var properties = EventHubsModelFactory.LastEnqueuedEventProperties(lastSequence, lastOffset, lastEnqueued, lastReceived); Assert.That(properties, Is.Not.Null, "The properties should have been created."); Assert.That(properties.SequenceNumber, Is.EqualTo(lastSequence), "The sequence number should have been set."); Assert.That(properties.Offset, Is.EqualTo(lastOffset), "The offset should have been set."); Assert.That(properties.EnqueuedTime, Is.EqualTo(lastEnqueued), "The enqueued date/time should have been set."); Assert.That(properties.LastReceivedTime, Is.EqualTo(lastReceived), "The last received date/time should have been set."); }
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."); }