zhengchun/Bobo-Browse.Net — pull request #4 by NightOwl888 (2014-11-21 18:06:59+00:00)
Title: Original unit tests

This is the same as #3, but also includes the original Unit tests from [here](https://bobo.codeplex.com/SourceControl/latest#BoboBrowse.Tests/BasicTests.cs).

I am fairly certain these tests are equivalent to the original source, but if you run them you will notice that `AutoCompleteTest` and `TestPathFacet` are both failing. Since these are the only tests we have to ensure this copy does what the 2.9.4 version does, we should strive to fix these issues.

After analyzing the stack trace, I discovered that the source of the problem lies on [line 118 of InternalBrowseHitCollector.cs](https://github.com/zhengchun/Bobo-Browse.Net/blob/master/src/BoboBrowse.Net/Search/InternalBrowseHitCollector.cs#L118), where it is getting an index out of range exception.

Another thing I noticed that doesn't look right when reviewing the source is [line 80](https://github.com/zhengchun/Bobo-Browse.Net/blob/master/src/BoboBrowse.Net/Search/InternalBrowseHitCollector.cs#L80).

```c#
// Fastmatch: return if this hit is not competitive
for (int i = 0; ; i++)
```

I *think* this line should be:

```c#
// Fastmatch: return if this hit is not competitive
for (int i = 0; i < hitQueue.comparators.Length; i++)
```