protected override void ExecuteTest()
 {
     studentListUtilitiesProvider = new StudentListUtilitiesProvider(metricStateProvider, metricNodeResolver);
     actualModel = studentListUtilitiesProvider.PrepareMetric(suppliedStudentUSI, suppliedSchoolId, suppliedUniqueIdentifier, suppliedMetricVariantId, suppliedMetricValue.ToString(), suppliedStateType, suppliedValueType);
 }
 protected override void ExecuteTest()
 {
     studentListUtilitiesProvider = new StudentListUtilitiesProvider(metricStateProvider, metricNodeResolver);
     actualModel = studentListUtilitiesProvider.PrepareMetric(suppliedStudentUSI, suppliedUniqueIdentifier, null, null, null, null, null);
 }
        public StudentWithMetrics.Metric PrepareMetric(long studentUSI, int schoolId, int uniqueIdentifier, int? metricVariantId, string metricValue, int? stateTypeId, string valueType)
        {
            if (metricVariantId == null)
                return new StudentWithMetrics.Metric(studentUSI) { UniqueIdentifier = uniqueIdentifier, State = MetricStateType.None };

            var additionalMetric = new StudentWithMetrics.Metric(studentUSI);
            var metricMetadataNode = metricNodeResolver.GetMetricNodeForStudentFromMetricVariantId(schoolId, metricVariantId.Value);
            if (metricMetadataNode == null)
                PrepareMetric(additionalMetric, uniqueIdentifier, metricVariantId, metricValue, stateTypeId, valueType, null);
            else
                PrepareMetric(additionalMetric, uniqueIdentifier, metricVariantId, metricValue, stateTypeId, valueType, metricMetadataNode.Format);

            return additionalMetric;
        }
        public StudentWithMetrics.Metric PrepareMetric(long studentUSI, int uniqueIdentifier, int? metricVariantId, string metricValue, int? stateTypeId, string valueType, string displayValueFormat)
        {
            if (metricVariantId == null)
                return new StudentWithMetrics.Metric(studentUSI) { UniqueIdentifier = uniqueIdentifier, State = MetricStateType.None };

            var additionalMetric = new StudentWithMetrics.Metric(studentUSI);
            PrepareMetric(additionalMetric, uniqueIdentifier, metricVariantId, metricValue, stateTypeId, valueType, displayValueFormat);

            return additionalMetric;
        }
        public StudentWithMetrics.Metric PrepareStateValueMetric(long studentUSI, int uniqueIdentifier, int? metricVariantId, int? stateTypeId)
        {
            if (metricVariantId == null || !stateTypeId.HasValue)
                return new StudentWithMetrics.Metric(studentUSI) { UniqueIdentifier = uniqueIdentifier, State = MetricStateType.None };

            var additionalMetric = new StudentWithMetrics.Metric(studentUSI);
            additionalMetric.UniqueIdentifier = uniqueIdentifier;
            additionalMetric.MetricVariantId = metricVariantId.Value;

            var metricId = metricNodeResolver.ResolveMetricId(metricVariantId.Value);
            var state = metricStateProvider.GetState(metricId, stateTypeId.Value);
            additionalMetric.Value = state.StateText;
            additionalMetric.DisplayValue = state.DisplayStateText;
            additionalMetric.State = (MetricStateType)stateTypeId.Value;
            return additionalMetric;
        }