public void FeedToken_PartitionKey_EnrichRequest() { PartitionKey pk = new PartitionKey("test"); FeedTokenPartitionKey token = new FeedTokenPartitionKey(pk); RequestMessage requestMessage = new RequestMessage(); token.EnrichRequest(requestMessage); Assert.AreEqual(pk.ToJsonString(), requestMessage.Headers.PartitionKey); Assert.ThrowsException <ArgumentNullException>(() => token.EnrichRequest(null)); }
public void IsFeedOperation_ForFeedTokenPartitionKey() { RequestMessage request = new RequestMessage(); request.OperationType = OperationType.ReadFeed; request.ResourceType = ResourceType.Document; FeedTokenInternal feedTokenEPKRange = new FeedTokenPartitionKey(new Cosmos.PartitionKey("0")); feedTokenEPKRange.EnrichRequest(request); Assert.IsFalse(request.IsPartitionKeyRangeHandlerRequired); }