public void OnActionExecuting_number_in_range_context_result_should_be_null(int value, int min, int max)
        {
            var context = SetContext(value, min, max);
            var filter  = new RangeValidationFilter();

            filter.OnActionExecuting(context);
            Assert.IsNull(context.Result);
        }
        public void OnActionExecuting_number_is_null_context_result_should_be_badrequest()
        {
            var context = SetContext(null, -10, 250);
            var filter  = new RangeValidationFilter();

            filter.OnActionExecuting(context);
            Assert.IsTrue(context.Result is BadRequestObjectResult);
            Assert.AreEqual((context.Result as BadRequestObjectResult).Value, "Missing input");
        }
        public void OnActionExecuting_number_below_range_context_result_should_be_badrequest(int value, int min, int max)
        {
            var context = SetContext(value, min, max);
            var filter  = new RangeValidationFilter();

            filter.OnActionExecuting(context);
            Assert.IsTrue(context.Result is BadRequestObjectResult);
            Assert.AreEqual((context.Result as BadRequestObjectResult).Value, $@"input out of range, it must be between {min} and {max}");
        }