Ejemplo n.º 1
0
        public virtual async Task <IActionResult> StatsAsync()
        {
            ContentStatitsics content = await _content.GetStatisticsAsync();

            UserStatistics users = await _account.GetStatisticsAsync();

            PropertyStatistics properties = await _property.GetStatisticsAsync();

            return(Json(new Statistics(content, users, properties)));
        }
Ejemplo n.º 2
0
        public ResourceStatisticsServiceTests()
        {
            _mockStatisticsRepository = new Mock <IResourceStatisticsRepository>();
            _mockMetadataService      = new Mock <IMetadataService>();

            // Init testdata
            _statisticsService = new ResourceStatisticsService(_mockStatisticsRepository.Object, _mockMetadataService.Object);

            _numberOfProperties   = new PropertyStatisticsBuilder().GenerateSampleCountOfPropertiesData().Build();
            _propertyUsageByGroup = new PropertyStatisticsBuilder().GenerateSamplePropertyUsageByGroupData().Build();
            _cvSelection          = new PropertyStatisticsBuilder().GenerateSampleControlledVocabularySelectionData().Build();

            _mockStatisticsRepository.Setup(s => s.GetNumberOfProperties(It.IsAny <List <string> >())).Returns(_numberOfProperties.Counts);
            _mockStatisticsRepository.Setup(s => s.GetNumberOfPropertyUsageByGroupOfResource(It.IsAny <Uri>())).Returns(_propertyUsageByGroup.Counts);
            _mockStatisticsRepository.Setup(s => s.GetNumberOfControlledVocabularySelection(It.IsAny <Uri>(), It.IsAny <List <string> >())).Returns(_cvSelection);
        }
Ejemplo n.º 3
0
 public Statistics(ContentStatitsics content, UserStatistics users, PropertyStatistics properties)
 {
     Content    = content;
     Users      = users;
     Properties = properties;
 }
Ejemplo n.º 4
0
 public PropertyStatisticsBuilder()
 {
     statistics = new PropertyStatistics();
 }
Ejemplo n.º 5
0
 private void AssertPropertyStatisticsResult(PropertyStatistics statistics, string name, int increment, int counts)
 {
     Assert.Equal(name, statistics.Name);
     Assert.Equal(increment, statistics.Increment);
     Assert.Equal(counts, statistics.Counts.Count);
 }