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

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

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

                await session.StoreDbFeatureAsync("MyOtherProduct", "Group1", "MyThirdFeature", "0.0.0");

                await session.SaveChangesAsync();
            }

            WaitForIndexing(documentStoreProvider.Store);

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

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

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

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

            await documentStoreProvider.StoreDbFeatureAsync("MyOtherProduct", "Group1", "MyThirdFeature", "0.0.0");

            WaitForIndexing(documentStoreProvider.Store);

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

            // Assert
            result.ShouldNotBeNull();
            result.Count().ShouldBe(1);
            result.FirstOrDefault()?.Title.ShouldBe("MyFirstFeature");
        }
Exemplo n.º 3
0
 public async Task <IEnumerable <FeatureDescription> > GetFeaturesForProductAndGroupAsync(string productName, string groupName)
 {
     return(await _featureManager.GetFeatureDescriptionsByProductAndGroupAsync(productName, groupName));
 }