public async Task QueryStatus_WithContinuationToken_InputToken()
        {
            var fixture    = new QueryFixture();
            var inputToken = new TableContinuationToken()
            {
                NextPartitionKey = "qux",
                NextRowKey       = "quux",
                NextTableName    = "corge",
            };

            var inputTokenString = JsonConvert.SerializeObject(inputToken);

            fixture.SetupQueryStateWithPagerWithInputToken(inputTokenString);

            var inputState = new List <OrchestrationStatus>();

            inputState.Add(OrchestrationStatus.Running);
            inputState.Add(OrchestrationStatus.Completed);
            inputState.Add(OrchestrationStatus.Failed);

            var result = await fixture.TrackingStore.GetStateAsync(fixture.ExpectedCreatedDateFrom, fixture.ExpectedCreatedDateTo, inputState, 3, fixture.InputToken);

            Assert.AreEqual(inputTokenString, fixture.ActualPassedTokenString);

            Assert.AreEqual(fixture.ExpectedResult.ContinuationToken, result.ContinuationToken);
            Assert.AreEqual(fixture.ExpectedResult.OrchestrationState.Count(), result.OrchestrationState.Count());
            Assert.AreEqual(fixture.ExpectedResult.OrchestrationState.FirstOrDefault().Name, result.OrchestrationState.FirstOrDefault().Name);
            fixture.VerifyQueryStateWithPager();
        }
Exemplo n.º 2
0
        public async Task QueryStatus_WithContinuationToken_NoInputToken()
        {
            var fixture = new QueryFixture();
            fixture.SetUpQueryStateWithPagerWithoutInputToken();

            var inputState = new List<OrchestrationStatus>();
            inputState.Add(OrchestrationStatus.Running);
            inputState.Add(OrchestrationStatus.Completed);
            inputState.Add(OrchestrationStatus.Failed);

            var result = await fixture.TrackingStore.GetStateAsync(fixture.ExpectedCreatedDateFrom, fixture.ExpectedCreatedDateTo, inputState, 3, fixture.InputToken);

            Assert.IsNull(fixture.ActualPassedTokenObject);

            Assert.AreEqual(fixture.ExpectedResult.ContinuationToken, result.ContinuationToken);
            Assert.AreEqual(fixture.ExpectedResult.OrchestrationState.Count(), result.OrchestrationState.Count());
            Assert.AreEqual(fixture.ExpectedResult.OrchestrationState.FirstOrDefault().Name, result.OrchestrationState.FirstOrDefault().Name);
            fixture.VerifyQueryStateWithPager();
        }
Exemplo n.º 3
0
 public QueryTest(QueryFixture <string, FakeQuery> queryFixture)
 {
     QueryFixture = queryFixture;
 }