public async Task IndicatorMaintenanceSucces() { var container = ComponentTestFactory.BuildContainer(); var(_, product) = await ComponentTestFactory.BuildCustomerProduct(container); var source = await ComponentTestFactory.BuildSource(container, product); var feature = await ComponentTestFactory.BuildFeature(container, product); var component = container.GetInstance <IndicatorComponent>(); await component.Create(feature, source); var indicators = await component.GetByFeature(feature); Assert.NotEmpty(indicators); foreach (var item in indicators) { var indicator = await component.GetById(item.Id); Assert.NotNull(indicator); Assert.NotNull(indicator.FeatureAvatar); Assert.NotNull(indicator.Feature); Assert.NotNull(indicator.Source); Assert.NotNull(indicator.SourceAvatar); } await component.Delete(indicators.Single().Id); indicators = await component.GetByFeature(feature); Assert.Empty(indicators); }
public async Task journeyMapMaintenanceSucces() { var container = ComponentTestFactory.BuildContainer(); var(_, productId) = await ComponentTestFactory.BuildCustomerProduct(container); var journey = await ComponentTestFactory.BuildJourney(container, productId); var feature = await ComponentTestFactory.BuildFeature(container, productId); var component = container.GetInstance <JourneyMapComponent>(); await component.CreateMap(new Models.JourneyMapPostRp() { FeatureId = feature, JourneyId = journey }); var journeys = await component.GetMaps(journey); Assert.NotEmpty(journeys); }
public async Task IndicatorComplementSuccess() { var container = ComponentTestFactory.BuildContainer(); var(_, product) = await ComponentTestFactory.BuildCustomerProduct(container); var source = await ComponentTestFactory.BuildSource(container, product); var source2 = await ComponentTestFactory.BuildSource(container, product, name : "second source"); var feature = await ComponentTestFactory.BuildFeature(container, product); var component = container.GetInstance <IndicatorComponent>(); await component.Create(feature, source); var indicators = await component.GetByFeature(feature); Assert.NotEmpty(indicators); var complement = await component.GetSourcesComplement(feature); Assert.NotEmpty(complement); }
public async Task SquadFeatureMaintenanceSucces() { var container = ComponentTestFactory.BuildContainer(); var(customer, product) = await ComponentTestFactory.BuildCustomerProduct(container); var feature = await ComponentTestFactory.BuildFeature(container, product); var squadComponent = container.GetInstance <SquadComponent>(); var squadQueryComponent = container.GetInstance <SquadQueryComponent>(); await squadComponent.CreateSquad(new Models.SquadPostRp() { Name = "test", CustomerId = customer }); var squad = await squadQueryComponent.GetSquadByName(customer, "test"); var all = await squadFeatureComponent.GetAll(); Assert.NotEmpty(all); }
public async Task SquadFeatureMaintenanceSucces() { var container = ComponentTestFactory.BuildContainer(); var(customer, product) = await ComponentTestFactory.BuildCustomerProduct(container); var featureComponent = container.GetInstance <FeatureComponent>(); var squadComponent = container.GetInstance <SquadComponent>(); var squadQueryComponent = container.GetInstance <SquadQueryComponent>(); var squadResponse = await squadComponent.CreateSquad(new Models.SquadPostRp() { Name = MockUtils.GenerateRandomName(), CustomerId = customer }); var squad = await squadQueryComponent.GetSquadById(squadResponse.Id); var feature = await ComponentTestFactory.BuildFeature(container, product); await featureComponent.RegisterSquad(new SquadFeaturePostRp() { SquadId = squad.Id, FeatureId = feature }); squad = await squadQueryComponent.GetSquadById(squad.Id); Assert.NotEmpty(squad.Features); await featureComponent.UnRegisterSquad(squad.Id, feature); squad = await squadQueryComponent.GetSquadById(squad.Id); Assert.Empty(squad.Features); }