Exemplo n.º 1
0
        private static bool IsMaximumConditionMet(MetricState stateRule, IComparable compValue, Type t)
        {
            bool metMaxValueCondition = false;

            if (stateRule.MaxValue != null)
            {
                if (stateRule.IsMaxValueInclusive != null)
                {
                    int comparedValue = compValue.CompareTo(Convert.ChangeType(stateRule.MaxValue.Value, t));

                    if (stateRule.IsMaxValueInclusive.Value != 0)//Is inclusive
                    {
                        if (comparedValue <= 0)
                            metMaxValueCondition = true;
                    }
                    else//Is not
                    {
                        if (comparedValue < 0)
                            metMaxValueCondition = true;
                    }
                }
            }

            return metMaxValueCondition;
        }
Exemplo n.º 2
0
        protected override void ExecuteTest()
        {
            actualModel = providerToTest.GetState(suppliedMetricId1, suppliedMetricValueForUpperLimitBoundaryTestForLow, suppliedMetricValueType1);

            //Picking the state that we are going to evaluate against.
            suppliedStateInContext = suppliedMetricMetadataTree.Descendants.Single(x => x.MetricId == suppliedMetricId1).States.Single(x => x.StateType == MetricStateType.Low);
        }
Exemplo n.º 3
0
        protected override void ExecuteTest()
        {
            actualModel = providerToTest.GetState(suppliedMetricId2, suppliedMetricValueForLowerLimitBoundaryTestForGoodNotInclusive, suppliedMetricValueType1);
            //actualModel = serviceToTest.Get(suppliedMetricId2, ".55", suppliedMetricValueType1);

            //Picking the state that we are going to evaluate against.
            suppliedStateInContext = suppliedMetricMetadataTree.Descendants.Single(x => x.MetricId == suppliedMetricId1).States.Single(x => x.StateType == MetricStateType.Good);
        }
Exemplo n.º 4
0
        protected override void ExecuteTest()
        {
            actualModel = providerToTest.GetState(suppliedMetricMetadataTree.Descendants.Single(x => x.MetricId == suppliedMetricId3), GetSuppliedMetricInstance());

            //Picking the state that we are going to evaluate against.
            suppliedStateInContext = suppliedMetricMetadataTree.Descendants.Single(x => x.MetricId == suppliedMetricId3).States.Single(x => x.StateType == MetricStateType.Low && x.MaxValue == .25m);
        }