public async Task CanDeleteFeaturesByProductGroupAndVersion() { // Arrange var documentStoreProvider = DocumentStoreProvider; await documentStoreProvider.Store.ExecuteIndexAsync(new Features_ByTitleProductAndGroup()); using (var session = documentStoreProvider.Store.OpenAsyncSession()) { await session.StoreDbFeatureAsync("MyProduct", "MyGroup", "My First Feature", "0.0.0"); await session.StoreDbFeatureAsync("MyProduct", "MyGroup", "My First Feature", "1.0.0"); await session.SaveChangesAsync(); } WaitForIndexing(documentStoreProvider.Store); // Act var sut = new FeatureManager(documentStoreProvider, configurationManager, logger); await sut.DeleteFeaturesAsync("MyProduct", "MyGroup", "0.0.0"); // Assert using (var session = documentStoreProvider.Store.OpenAsyncSession()) { var features = await session.Query <DbFeature>().ToListAsync(); features.ShouldNotBeNull(); features.Count.ShouldBe(1); var remainingFeature = features.FirstOrDefault(); remainingFeature.ShouldNotBeNull(); remainingFeature.Version.ShouldBe("1.0.0"); } }
public async Task CanDeleteFeaturesByProductAndGroup() { // Arrange var documentStoreProvider = DocumentStoreProvider; await documentStoreProvider.StoreDbFeatureAsync("MyProduct", "MyGroup", "My First Feature", "0.0.0"); await documentStoreProvider.StoreDbFeatureAsync("MyProduct", "MyOtherGroup", "My Second Feature", "0.0.0"); WaitForIndexing(documentStoreProvider.Store); // Act var sut = new FeatureManager(documentStoreProvider, logger); await sut.DeleteFeaturesAsync("MyProduct", "MyGroup"); WaitForIndexing(documentStoreProvider.Store); // Assert using (var session = documentStoreProvider.Store.OpenAsyncSession()) { var features = await session.Query <DbFeature>().ToListAsync(); features.ShouldNotBeNull(); features.Count.ShouldBe(1); var remainingFeature = features.FirstOrDefault(); remainingFeature.ShouldNotBeNull(); remainingFeature.Title.ShouldBe("My Second Feature"); } }
public async Task DeleteGroupAsync(string productName, string groupName) { await _featureManager.DeleteFeaturesAsync(productName, groupName); }
public async Task DeleteAsync(string branchName, string groupName) { await _featureManager.DeleteFeaturesAsync(branchName, groupName); }