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 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);
        }
Exemple #3
0
        public async Task SourceItemEndMiddle()
        {
            var container = ComponentTestFactory.BuildContainer();

            var(_, product) = await ComponentTestFactory.BuildCustomerProduct(container);

            var source = await ComponentTestFactory.BuildSource(container, product : product);

            var sourceComponent = container.GetInstance <SourceComponent>();
            var itemComponent   = container.GetInstance <SourceItemComponent>();

            await itemComponent.CreateAvailabilityItem(new SourceItemAvailabilityPostRp()
            {
                SourceId = source,
                Start    = OwlveyCalendar.January201905,
                End      = OwlveyCalendar.January201910,
                Good     = 900,
                Total    = 1000
            });

            var items = await itemComponent.GetBySourceIdAndDateRange(source, OwlveyCalendar.January201908, OwlveyCalendar.January201912);

            Assert.NotEmpty(items);
        }