Exemplo n.º 1
0
 public void WhenPushingMultipleBracesDepthIsIncreased()
 {
     var stack = new PerBraceStacker(braceList);
       stack.Push(new CharPos('{', 0));
       stack.Push(new CharPos('{', 0));
       Assert.Equal(1, stack.Pop('{').Depth);
       Assert.Equal(0, stack.Pop('{').Depth);
 }
Exemplo n.º 2
0
 public void WhenAddingOneOfEachCountIs1()
 {
     var stack = new PerBraceStacker(braceList);
       stack.Push(new CharPos('{', 0));
       stack.Push(new CharPos('(', 0));
       Assert.Equal(1, stack.Count('{'));
       Assert.Equal(1, stack.Count('('));
 }
Exemplo n.º 3
0
 public void WhenRemovingOneTheCountOfTheOtherIsNotReduced()
 {
     var stack = new PerBraceStacker(braceList);
       stack.Push(new CharPos('{', 0));
       stack.Push(new CharPos('(', 0));
       stack.Pop('{');
       Assert.Equal(0, stack.Count('{'));
       Assert.Equal(1, stack.Count('('));
 }
Exemplo n.º 4
0
 public void WhenEmptyCountIsZero()
 {
     var stack = new PerBraceStacker(braceList);
       Assert.Equal(0, stack.Count('{'));
 }