GetWhitespaceBefore() private method

private GetWhitespaceBefore ( ITextSource textSource, int offset ) : ISegment
textSource ITextSource
offset int
return ISegment
 public void TestGetWhitespaceBeforeUntilStartOfString()
 {
     Assert.AreEqual(new SimpleSegment(0, 2), TextUtilities.GetWhitespaceBefore(new StringTextSource(" \t a"), 2));
 }
 public void TestGetWhitespaceBeforeDoesNotSkipNewLine()
 {
     Assert.AreEqual(new SimpleSegment(2, 1), TextUtilities.GetWhitespaceBefore(new StringTextSource("a\n b"), 3));
 }
 public void TestGetWhitespaceBeforeEmptyResult()
 {
     Assert.AreEqual(new SimpleSegment(2, 0), TextUtilities.GetWhitespaceBefore(new StringTextSource(" a b"), 2));
 }
 public void TestGetWhitespaceBefore()
 {
     Assert.AreEqual(new SimpleSegment(1, 3), TextUtilities.GetWhitespaceBefore(new StringTextSource("a\t \t b"), 4));
 }