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."); }
public void CheckValidIndex_ValidIndex_ShouldMarkAsValid() { var parser = new ParserHelperUtil(); var valid = parser.CheckValidIndex(new ParseTO(), "1", 1, 2); Assert.IsTrue(valid, "Valid recordset index marked as invalid."); }
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); } }
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); } }
public void CheckValidIndex_GivenNegetiveIndex_ShouldThrow_TooHighError() { var parser = new ParserHelperUtil(); try { parser.CheckValidIndex(new ParseTO(), "-1", 1, 2); } catch (Exception ex) { Assert.AreEqual("Recordset index [ -1 ] is not greater than zero", ex.Message); } }
public void CheckValidIndex_GivenNegetiveIndex_ShouldThrow_InvalidCharacterError() { var parser = new ParserHelperUtil(); try { parser.CheckValidIndex(new ParseTO(), "a", 1, 2); } catch (Exception ex) { Assert.AreEqual("Recordset index (a) contains invalid character(s)", ex.Message); } }