protected override void EstablishContext()
 {
     metadataNode = getSuppliedMetaDataNode();
     suppliedGranularMetricFlagged = new GranularMetric<int> { MetricId = 20 };
     suppliedGranularMetricNotFlagged = new GranularMetric<int> { MetricId = 40 };
     suppliedMetricDataFlagged = new CurrentYearMetricData { MetricInstances = (new List<MetricInstance>() { new MetricInstance { MetricId = 20, Flag = true } }).AsQueryable() };
     suppliedMetricDataNotFlagged = new CurrentYearMetricData { MetricInstances = (new List<MetricInstance>() { new MetricInstance { MetricId = 40, Flag = false } }).AsQueryable() };
 }
示例#2
0
        public bool GetMetricFlag(MetricBase metricBase, MetricMetadataNode metadataNode, MetricData metricData)
        {
            var metricInstance = metricData.MetricInstancesByMetricId.GetValueOrDefault(metricBase.MetricId);

            if (metricInstance == null)
                return false;

            return metricInstance.Flag.GetValueOrDefault();
        }
示例#3
0
        public Goal GetMetricGoal(MetricMetadataNode metricMetadataNode, MetricData metricData)
        {
            if (metricData.MetricGoalsByMetricId == null)
                return null;

            var goalData = metricData.MetricGoalsByMetricId.GetValueOrDefault(metricMetadataNode.MetricId);
            var metricInstance = metricData.MetricInstancesByMetricId.GetValueOrDefault(metricMetadataNode.MetricId);

            return CalculateGoal(metricMetadataNode, goalData, metricInstance);
        }
 protected override void ExecuteTest()
 {
     var provider = new CurrentYearMetricDataProvider<TestMetricInstanceSetRequestBase>(metricInstanceSetKeyResolver,
                                                                                         metricInstancesService, 
                                                                                         metricInstanceExtendedPropertiesService, 
                                                                                         metricComponentsService, 
                                                                                         metricGoalsService, 
                                                                                         metricIndicatorsService, 
                                                                                         metricInstanceFootnotesService, 
                                                                                         metricFootnoteDescType);
     actualModel = provider.Get(suppliedRequest);
 }
 protected override void ExecuteTest()
 {
     var service = new SchoolMetricDataProvider(schoolMetricDataService, schoolBriefService, metricInstanceSetKeyResolver, warehouseAvailabilityProvider, maxPriorYearProvider);
     actualModel = service.Get(suppliedRequest);
 }
 protected override void ExecuteTest()
 {
     var service = new SchoolMetricDataService(metricInstanceRepository, metricInstanceExtendedPropertyRepository, metricComponentRepository);
     var provider = new SchoolMetricDataProvider(service, schoolBriefService, metricInstanceSetKeyResolver, warehouseAvailabilityProvider, maxPriorYearProvider);
     actualModel = provider.Get(suppliedRequest);
 }
 protected virtual void InvokeInitializationActivities(MetricBase metric, MetricInstanceSetRequestBase metricInstanceSetRequest, MetricMetadataNode metadataNode, 
                                                       MetricData metricData, Dictionary<string, object> initializationActivityData)
 {
     foreach (var initializationActivity in metricInitializationActivities)
         initializationActivity.InitializeMetric(metric, metricInstanceSetRequest, metadataNode, metricData, initializationActivityData);
 }
        protected override void EstablishContext()
        {
            //Prepare supplied data collections
            suppliedMetricData = GetSuppliedMetricData();
            suppliedMetricMetadataTree = GetSuppliedMetricMetadataTree();

            //Set up the mocks
            metricMetadataNodeService = mocks.StrictMock<IMetricMetadataTreeService>();
            metricGoalsService = mocks.StrictMock<IMetricGoalsService>();
            metricInstancesService = mocks.StrictMock<IMetricInstancesService>();
            cacheProvider = mocks.StrictMock<ICacheProvider>();
        }