public void ConsiderTest1(
            [Range(0.0f, 10.0f, 2.5f)] float xval1,
            [Range(0.0f, 10.0f, 2.5f)] float xval2)
        {
            // NEVER use the derived class to call
            // Consider otherwise the machinery in the base
            // class is never called!
            var c = ConsiderationConstructor.ConstrainedChebyshev();

            var cd1 = new OptionConsideration1();
            var cd2 = new OptionConsideration2();

            cd1.NameId = "cd1";
            cd2.NameId = "cd2";
            c.AddConsideration(cd1);
            c.AddConsideration(cd2);
            _optionContext.XVal1 = xval1;
            _optionContext.XVal2 = xval2;
            cd1.Consider(_optionContext);
            cd2.Consider(_optionContext);
            var cUtil1 = cd1.Utility;
            var cUtil2 = cd2.Utility;
            var cUtilL = new List <Utility>();

            cUtilL.Add(cUtil1);
            cUtilL.Add(cUtil2);
            var cNorm = cUtilL.Chebyshev();

            c.Consider(_optionContext);
            Assert.That(c.Utility.Value, Is.EqualTo(cNorm).Within(Tolerance));
        }
        public void ConstuctorTest2([Range(-1.0f, 2.0f, 0.1f)] float threshold)
        {
            var c = ConsiderationConstructor.ConstrainedChebyshev(threshold);

            Assert.That(c.Weight, Is.EqualTo(1.0f).Within(Tolerance));
            Assert.That((c.Measure as ConstrainedChebyshev).LowerBound, Is.EqualTo(threshold.Clamp01()).Within(Tolerance));
        }
        public void ConstrainedChebyshevConstructor()
        {
            var c = ConsiderationConstructor.ConstrainedChebyshev();

            Assert.IsNotNull(c);
            Assert.IsNotNull(c.Measure);
            Assert.That(c.Measure is ConstrainedChebyshev);
        }
        public void ConstrainedChebyshevNameConstructor()
        {
            var cc = new ConsiderationCollection();
            var c  = ConsiderationConstructor.ConstrainedChebyshev("name", cc);

            Assert.IsNotNull(c);
            Assert.IsNotNull(c.Measure);
            Assert.That(c.Measure is ConstrainedChebyshev);
            Assert.That(cc.Contains("name"));
        }
        public void ConstrainedChebyshevNameAndLowerBoundConstructor()
        {
            var cc = new ConsiderationCollection();
            var c  = ConsiderationConstructor.ConstrainedChebyshev("name", cc, 0.5f);

            Assert.IsNotNull(c);
            Assert.IsNotNull(c.Measure);
            Assert.That(c.Measure is ConstrainedChebyshev);
            var m = c.Measure as ConstrainedChebyshev;

            Assert.That(m.LowerBound, Is.EqualTo(0.5f));
            Assert.That(cc.Contains("name"));
        }
        public void ConstuctorTest1()
        {
            var c = ConsiderationConstructor.ConstrainedChebyshev();

            Assert.That(c.Weight, Is.EqualTo(1.0f).Within(Tolerance));
        }