Ejemplo n.º 1
0
        public void GetFloatWithMaxThatExceedsMaxReturnsMinMinusOne()
        {
            var key = "Hi there";
            var val = "11.09";
            var pd  = new ParameterDatabase();

            Assert.AreEqual(pd.Count, 0);

            var p1 = new Parameter(key);

            pd.SetParameter(p1, val);
            var v = pd.GetFloatWithMax(p1, null, 5.09, 10.09); // Min is 5, max is 10, then the return value is 4

            Assert.AreEqual(v, 4.09f);
        }
Ejemplo n.º 2
0
        public void GetFloatWithMaxReturnsMinusOneWhenMinIsZero()
        {
            var key = "Hi there";
            var val = "11.29";
            var pd  = new ParameterDatabase();

            Assert.AreEqual(pd.Count, 0);

            var p1 = new Parameter(key);

            pd.SetParameter(p1, val);
            var v = pd.GetFloatWithMax(p1, null, 0.0, 10.09); // Min is 0.0, max is 10.09, then the return value is -1.0

            Assert.AreEqual(v, -1.0f);
        }