public void CanCreateInstance() { var l = new LexInfo("t", 1, 2, 3, 4); Assert.AreEqual("t", l.File); Assert.AreEqual(1, l.Line); Assert.AreEqual(2, l.Column); Assert.AreEqual(3, l.CharIndex); Assert.AreEqual(4, l.Length); }
public void CanCreateCopy() { var l = new LexInfo("t", 1, 2, 3, 4); var l2 = l.Clone(); Assert.AreNotSame(l, l2); Assert.AreEqual("t", l2.File); Assert.AreEqual(1, l2.Line); Assert.AreEqual(2, l2.Column); Assert.AreEqual(3, l2.CharIndex); Assert.AreEqual(4, l2.Length); }
public void GeneratesValidString() { var l = new LexInfo("t", 1, 2, 3, 4); Assert.AreEqual(" at t : 1:2", l.ToString()); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> protected bool Equals(LexInfo other) { return(Column == other.Column && string.Equals(File, other.File) && Line == other.Line); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> protected bool Equals(LexInfo other){ return Column == other.Column && string.Equals(File, other.File) && Line == other.Line; }