Esempio n. 1
0
        public void CheckCurrentIndex_GivenPositiveIndex_ShouldMarkAsValid()
        {
            var parser = new ParserHelperUtil();
            var invoke = parser.CheckCurrentIndex(new ParseTO(), 3, "rec(1)", "rec(1)".Length);

            Assert.IsTrue(invoke, "Positive recordset index marked as invalid.");
        }
Esempio n. 2
0
        public void CheckCurrentIndex_GivenInvalid_ShouldThrow_LessThanZeroException()
        {
            var parser = new ParserHelperUtil();

            try
            {
                parser.CheckCurrentIndex(new ParseTO(), 3, "rec(-1)", "rec(-1)".Length);
            }
            catch (Exception ex)
            {
                Assert.AreEqual("Recordset index -1 is not greater than zero", ex.Message);
            }
        }
Esempio n. 3
0
        public void CheckCurrentIndex_GivenInvalid_ShouldThrow_InvalidCharException()
        {
            var parser = new ParserHelperUtil();

            try
            {
                parser.CheckCurrentIndex(new ParseTO(), 0, "rec(a).name", "a".Length);
            }
            catch (Exception ex)
            {
                Assert.AreEqual("Recordset index (ec(a).nam) contains invalid character(s)", ex.Message);
            }
        }