public int ItCountsDeltaIndentsDivibleByLearnedIndentsPerLine(string whitespaceTrainer,string previous, string line) { var sut = new WhitespaceEater(); var lineCnt = 1; foreach(var trainer in whitespaceTrainer.Split(';')) { sut.Eat(trainer, lineCnt++); } sut.Eat(previous, lineCnt++); return sut.Eat(line, lineCnt++).DeltaIndents; }
public int ItCountsIndentsDivibleByLearnedIndentsPerLine(string previous, string line) { var sut = new WhitespaceEater(); sut.Eat(previous, 1); return sut.Eat(line, 2).Indents; }
public int ItCountsIndents(string line) { var sut = new WhitespaceEater(); return sut.Eat(line, 1).Indents; }
public void ItDoesNotAllowMoreThanOneTabbingLevelIncreaseAtATime() { var sut = new WhitespaceEater(); sut.Eat("\t", 0); sut.Eat("a", 1); Assert.Catch<InconsistentWhitespaceException>(() => sut.Eat("\t\tb", 2)); }
public int ItCountsOpenIndents(string whitespaceTrainer,string line) { var sut = new WhitespaceEater(); sut.Eat(whitespaceTrainer, 0); sut.Eat(line, 1); return sut.OpenIndents; }