public void IsEquivalentToDetectsLastModifiedTime() { var first = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId", lastModifiedTime: DateTimeOffset.Parse("1975-04-04T00:00:00Z")); var second = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId", lastModifiedTime: DateTimeOffset.Parse("1975-04-04T01:00:00Z")); Assert.That(first.IsEquivalentTo(second), Is.False); var third = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId"); Assert.That(first.IsEquivalentTo(third), Is.False); }
public void IsEquivalentToDetectsPartitionId() { var first = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId1"); var second = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId2"); Assert.That(first.IsEquivalentTo(second), Is.False); }
public void IsEquivalentToDetectsOffset(long?offset1, long?offset2) { var first = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId", offset: offset1); var second = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId", offset: offset2); Assert.That(first.IsEquivalentTo(second), Is.False); }
public void IsEquivalentToDetectsSequenceNumber(long?sequenceNumber1, long?sequenceNumber2) { var first = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId", sequenceNumber: sequenceNumber1); var second = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId", sequenceNumber: sequenceNumber2); Assert.That(first.IsEquivalentTo(second), Is.False); }
public void IsEquivalentToDetectsEqualPartitionOwnership() { var first = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId", DateTimeOffset.Parse("1975-04-04T00:00:00Z"), "eTag"); var second = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId", DateTimeOffset.Parse("1975-04-04T00:00:00Z"), "eTag"); Assert.That(first.IsEquivalentTo(second), Is.True); // Set the optional parameters to null. first = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId"); second = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId"); Assert.That(first.IsEquivalentTo(second), Is.True); }
public void IsEquivalentToDetectsNullArgument() { var first = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId"); Assert.That(first.IsEquivalentTo(null), Is.False); }
public void IsEquivalentToDetectsSameInstance() { var first = new MockPartitionOwnership("namespace", "eventHubName", "consumerGroup", "ownerIdentifier", "partitionId"); Assert.That(first.IsEquivalentTo(first), Is.True); }