public void FeatureAvailabilityMix()
        {
            var Source_A = new SourceEntity();

            Source_A.AddSourceItem(800, 1000, OwlveyCalendar.January201903, DateTime.Now, "test", SourceGroupEnum.Availability);
            var Source_B = new SourceEntity();

            Source_B.AddSourceItem(90, 100, OwlveyCalendar.January201903, DateTime.Now, "test", SourceGroupEnum.Availability);
            var Indicators = new List <IndicatorEntity>()
            {
                new IndicatorEntity()
                {
                    Id     = 1,
                    Source = Source_A
                },
                new IndicatorEntity()
                {
                    Id     = 2,
                    Source = Source_B
                }
            };
            var entity = new FeatureEntity()
            {
                Id         = 1,
                Name       = "test",
                Indicators = Indicators
            };

            var result = entity.Measure();

            Assert.Equal(0.85m, result.Availability);
        }
        public void FeatureDateAvailabilityAggregateSuccess()
        {
            var sourceEntity = new SourceEntity()
            {
            };

            sourceEntity.AddSourceItem(800, 1000, OwlveyCalendar.January201903, DateTime.Now, "test", SourceGroupEnum.Availability);

            var entity = new FeatureEntity()
            {
                Id         = 1,
                Name       = "test",
                Indicators = new List <IndicatorEntity>()
                {
                    new IndicatorEntity()
                    {
                        Id     = 1,
                        Source = sourceEntity
                    }
                }
            };

            var result = entity.Measure();

            Assert.Equal(0.8m, result.Availability);
        }
Example #3
0
        public ExportExcelFeatureRp(FeatureEntity feature)
        {
            this.FeatureId = feature.Id.Value;
            this.Name      = feature.Name;
            var measure = feature.Measure();

            this.Availability = measure.Availability;
            this.Latency      = measure.Latency;
            this.Experience   = measure.Experience;
        }