Exemplo n.º 1
0
        public async Task CanGetFeatureDescriptionsByBranchAndTagAsync()
        {
            // Arrange
            var documentStoreProvider = DocumentStoreProvider;
            await documentStoreProvider.Store.ExecuteIndexAsync(new Features_ByProductAndBranch());

            using (var session = documentStoreProvider.Store.OpenAsyncSession())
            {
                await session.StoreDbFeatureAsync("MyProduct", "Group1", "MyFirstFeature", "0.0.0", "tag1");

                await session.StoreDbFeatureAsync("MyProduct", "Group1", "MySecondFeature", "0.0.0", "tag1", "tag2");

                await session.StoreDbFeatureAsync("MyProduct", "Group2", "MyOtherFeature", "0.0.0", "tag3");

                await session.SaveChangesAsync();
            }

            WaitForIndexing(documentStoreProvider.Store);

            // Act
            var sut    = new FeatureManager(documentStoreProvider, configurationManager, logger);
            var result = await sut.GetFeatureDescriptionsByBranchAndTagAsync("MyProduct", "tag1");

            // Assert
            result.ShouldNotBeNull();
            result.Count().ShouldBe(2);
            result.FirstOrDefault()?.Title.ShouldBe("MyFirstFeature");
            result.LastOrDefault()?.Title.ShouldBe("MySecondFeature");
        }
Exemplo n.º 2
0
        public async Task CanGetFeatureDescriptionsByBranchAndTagAsync()
        {
            // Arrange
            var documentStoreProvider = DocumentStoreProvider;

            await documentStoreProvider.StoreDbFeatureAsync("MyProduct", "Group1", "MyFirstFeature", "0.0.0", "tag1");

            await documentStoreProvider.StoreDbFeatureAsync("MyProduct", "Group1", "MySecondFeature", "0.0.0", "tag1", "tag2");

            await documentStoreProvider.StoreDbFeatureAsync("MyProduct", "Group2", "MyOtherFeature", "0.0.0", "tag3");

            WaitForIndexing(documentStoreProvider.Store);

            // Act
            var sut    = new FeatureManager(documentStoreProvider, logger);
            var result = await sut.GetFeatureDescriptionsByBranchAndTagAsync("MyProduct", "tag1");

            // Assert
            result.ShouldNotBeNull();
            result.Count().ShouldBe(2);
            result.FirstOrDefault()?.Title.ShouldBe("MyFirstFeature");
            result.LastOrDefault()?.Title.ShouldBe("MySecondFeature");
        }
Exemplo n.º 3
0
 public async Task <IEnumerable <FeatureDescription> > GetFeaturesAsync(string branchName, string tag)
 {
     return(await _featureManager.GetFeatureDescriptionsByBranchAndTagAsync(branchName, tag));
 }