Пример #1
0
 public void TestAtMost()
 {
     Assert.AreEqual("notNumber", StandardFilters.AtMost("notNumber", 5));
     Assert.AreEqual(5, StandardFilters.AtMost(5, 5));
     Assert.AreEqual(3, StandardFilters.AtMost(3, 5));
     Assert.AreEqual(5, StandardFilters.AtMost(6, 5));
     Assert.AreEqual(5, StandardFilters.AtMost(10, 5));
     Assert.AreEqual(5, StandardFilters.AtMost(9.85, 5));
     Assert.AreEqual(3.56, StandardFilters.AtMost(3.56, 5));
     Assert.AreEqual(5, StandardFilters.AtMost("10", 5));
     Assert.AreEqual(4, StandardFilters.AtMost("4", 5));
     Assert.AreEqual("4a", StandardFilters.AtMost("4a", 5));
     Assert.AreEqual("10b", StandardFilters.AtMost("10b", 5));
 }
Пример #2
0
        public void TestAtMost()
        {
            Assert.AreEqual("notNumber", StandardFilters.AtMost("notNumber", 5));
            Assert.AreEqual(5, StandardFilters.AtMost(5, 5));
            Assert.AreEqual(3, StandardFilters.AtMost(3, 5));
            Assert.AreEqual(5, StandardFilters.AtMost(6, 5));
            Assert.AreEqual(5, StandardFilters.AtMost(10, 5));
            Assert.AreEqual(5, StandardFilters.AtMost(9.85, 5));
            Assert.AreEqual(3.56, StandardFilters.AtMost(3.56, 5));
            Assert.AreEqual(5, StandardFilters.AtMost("10", 5));
            Assert.AreEqual(4, StandardFilters.AtMost("4", 5));
            Assert.AreEqual("4a", StandardFilters.AtMost("4a", 5));
            Assert.AreEqual("10b", StandardFilters.AtMost("10b", 5));

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