public Enumerator(PathTokenizer tokenizer) { _path = tokenizer._path; _index = -1; _length = -1; }
public void PathTokenizer_Enumerator(string path, StringSegment[] expectedSegments) { // Arrange var tokenizer = new PathTokenizer(new PathString(path)); // Act & Assert Assert.Equal <StringSegment>(expectedSegments, tokenizer); }
public void PathTokenizer_Indexer(string path, StringSegment[] expectedSegments) { // Arrange var tokenizer = new PathTokenizer(new PathString(path)); // Act & Assert for (var i = 0; i < expectedSegments.Length; i++) { Assert.Equal(expectedSegments[i], tokenizer[i]); } }
public void PathTokenizer_Count(string path, StringSegment[] expectedSegments) { // Arrange var tokenizer = new PathTokenizer(new PathString(path)); // Act var count = tokenizer.Count; // Assert Assert.Equal(expectedSegments.Length, count); }