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"); }
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"); }
public async Task <IEnumerable <FeatureDescription> > GetFeaturesForProductAndGroupAsync(string productName, string groupName) { return(await _featureManager.GetFeatureDescriptionsByProductAndGroupAsync(productName, groupName)); }