Exemple #1
0
        public void VerifyThatOptionDepStateFullValueSetsComparerCompareReturnsExpectedResults()
        {
            var parameter = new Parameter(Guid.NewGuid(), null, null);

            parameter.IsOptionDependent = true;
            var parameterValueSetaa = new ParameterValueSet();
            var parameterValueSetab = new ParameterValueSet();
            var parameterValueSetbb = new ParameterValueSet();
            var parameterValueSetba = new ParameterValueSet();

            parameter.ValueSet.Add(parameterValueSetaa);
            parameter.ValueSet.Add(parameterValueSetab);
            parameter.ValueSet.Add(parameterValueSetbb);
            parameter.ValueSet.Add(parameterValueSetba);

            parameterValueSetaa.ActualOption = this.optiona;
            parameterValueSetaa.ActualState  = this.actualFiniteStatea;

            parameterValueSetab.ActualOption = this.optiona;
            parameterValueSetab.ActualState  = this.actualFiniteStateb;

            parameterValueSetbb.ActualOption = this.optionb;
            parameterValueSetbb.ActualState  = this.actualFiniteStateb;

            parameterValueSetba.ActualOption = this.optionb;
            parameterValueSetba.ActualState  = this.actualFiniteStatea;

            var parameterOverride = new ParameterOverride();

            parameterOverride.Parameter = parameter;

            var aa = new ParameterOverrideValueSet();

            aa.ParameterValueSet = parameterValueSetaa;

            var ab = new ParameterOverrideValueSet();

            ab.ParameterValueSet = parameterValueSetab;

            var bb = new ParameterOverrideValueSet();

            bb.ParameterValueSet = parameterValueSetbb;

            var ba = new ParameterOverrideValueSet();

            ba.ParameterValueSet = parameterValueSetba;

            var comparer = new ParameterOverrideValueSetComparer();

            var comparison_aa_ab = comparer.Compare(aa, ab);

            Assert.AreEqual(1, comparison_aa_ab);

            var comparison_aa_bb = comparer.Compare(aa, ab);

            Assert.AreEqual(1, comparison_aa_bb);
        }
Exemple #2
0
        public void verifyThatOptionDependentValuesetsComparerCompareReturnsExpectedResults()
        {
            var parameter = new Parameter(Guid.NewGuid(), null, null);

            parameter.IsOptionDependent = true;
            var parameterValueSeta = new ParameterValueSet();
            var parameterValueSetb = new ParameterValueSet();

            parameter.ValueSet.Add(parameterValueSeta);
            parameter.ValueSet.Add(parameterValueSetb);

            parameterValueSeta.ActualOption = this.optiona;
            parameterValueSetb.ActualOption = this.optionb;

            var parameterOverride = new ParameterOverride();

            parameterOverride.Parameter = parameter;

            var parameterOverrideValueSeta = new ParameterOverrideValueSet();

            parameterOverrideValueSeta.ParameterValueSet = parameterValueSeta;

            var optiondepaparametervaluesetb = new ParameterOverrideValueSet();

            optiondepaparametervaluesetb.ParameterValueSet = parameterValueSetb;

            var comparer     = new ParameterOverrideValueSetComparer();
            var comparisonab = comparer.Compare(parameterOverrideValueSeta, optiondepaparametervaluesetb);

            Assert.AreEqual(1, comparisonab);

            var comparisonba = comparer.Compare(optiondepaparametervaluesetb, parameterOverrideValueSeta);

            Assert.AreEqual(-1, comparisonba);

            var comparisonaa = comparer.Compare(parameterOverrideValueSeta, parameterOverrideValueSeta);

            Assert.AreEqual(0, comparisonaa);

            var comparisonbb = comparer.Compare(optiondepaparametervaluesetb, optiondepaparametervaluesetb);

            Assert.AreEqual(0, comparisonbb);
        }
Exemple #3
0
        public void VerifyThatStateFullValueSetsComparerCompareReturnsExpectedResults()
        {
            var parameter = new Parameter(Guid.NewGuid(), null, null);

            parameter.IsOptionDependent = true;
            var parameterValueSeta = new ParameterValueSet();
            var parameterValueSetb = new ParameterValueSet();

            parameter.ValueSet.Add(parameterValueSeta);
            parameter.ValueSet.Add(parameterValueSetb);

            parameterValueSeta.ActualState = this.actualFiniteStatea;
            parameterValueSetb.ActualState = this.actualFiniteStateb;

            var parameterOverride = new ParameterOverride();

            parameterOverride.Parameter = parameter;

            var parameterOverrideValueSeta = new ParameterOverrideValueSet();

            parameterOverrideValueSeta.ParameterValueSet = parameterValueSeta;

            var parameterOverrideValueSetb = new ParameterOverrideValueSet();

            parameterOverrideValueSetb.ParameterValueSet = parameterValueSetb;

            var comparer     = new ParameterOverrideValueSetComparer();
            var comparisonab = comparer.Compare(parameterOverrideValueSeta, parameterOverrideValueSetb);

            Assert.AreEqual(1, comparisonab);

            var comparisonba = comparer.Compare(parameterOverrideValueSetb, parameterOverrideValueSeta);

            Assert.AreEqual(-1, comparisonba);

            var comparisonaa = comparer.Compare(parameterOverrideValueSeta, parameterOverrideValueSeta);

            Assert.AreEqual(0, comparisonaa);

            var comparisonbb = comparer.Compare(parameterOverrideValueSetb, parameterOverrideValueSetb);

            Assert.AreEqual(0, comparisonbb);
        }