public void TestAtLeast()
 {
     Assert.AreEqual("notNumber", StandardFilters.AtLeast("notNumber", 5));
     Assert.AreEqual(5, StandardFilters.AtLeast(5, 5));
     Assert.AreEqual(5, StandardFilters.AtLeast(3, 5));
     Assert.AreEqual(6, StandardFilters.AtLeast(6, 5));
     Assert.AreEqual(10, StandardFilters.AtLeast(10, 5));
     Assert.AreEqual(9.85, StandardFilters.AtLeast(9.85, 5));
     Assert.AreEqual(5, StandardFilters.AtLeast(3.56, 5));
     Assert.AreEqual(10, StandardFilters.AtLeast("10", 5));
     Assert.AreEqual(5, StandardFilters.AtLeast("4", 5));
     Assert.AreEqual("10a", StandardFilters.AtLeast("10a", 5));
     Assert.AreEqual("4b", StandardFilters.AtLeast("4b", 5));
 }
Esempio n. 2
0
        public void TestAtLeast()
        {
            Assert.AreEqual("notNumber", StandardFilters.AtLeast("notNumber", 5));
            Assert.AreEqual(5, StandardFilters.AtLeast(5, 5));
            Assert.AreEqual(5, StandardFilters.AtLeast(3, 5));
            Assert.AreEqual(6, StandardFilters.AtLeast(6, 5));
            Assert.AreEqual(10, StandardFilters.AtLeast(10, 5));
            Assert.AreEqual(9.85, StandardFilters.AtLeast(9.85, 5));
            Assert.AreEqual(5, StandardFilters.AtLeast(3.56, 5));
            Assert.AreEqual(10, StandardFilters.AtLeast("10", 5));
            Assert.AreEqual(5, StandardFilters.AtLeast("4", 5));
            Assert.AreEqual("10a", StandardFilters.AtLeast("10a", 5));
            Assert.AreEqual("4b", StandardFilters.AtLeast("4b", 5));

            Helper.AssertTemplateResult(
                expected: "5",
                template: "{{ 4 | at_least: 5 }}");
            Helper.AssertTemplateResult(
                expected: "4",
                template: "{{ 4 | at_least: 3 }}");
        }