Ejemplo n.º 1
0
        public void Test_Trivial_Bool_Props(string propName)
        {
            var queryParams = new LodgingQueryParamsModel();
            var prop        = queryParams.GetType().GetProperty(propName);

            prop.SetValue(queryParams, true);
            Assert.Equal(true, prop.GetValue(queryParams));
        }
Ejemplo n.º 2
0
        public void Test_Clamped_Props_Double(string propName, double min, double max)
        {
            var queryParams = new LodgingQueryParamsModel();
            var prop        = queryParams.GetType().GetProperty(propName);

            prop.SetValue(queryParams, -99999999);
            Assert.Equal(min, prop.GetValue(queryParams));

            if (min != max)
            {
                prop.SetValue(queryParams, 99999999);
                Assert.Equal(max, prop.GetValue(queryParams));
            }
        }