public void TestNotFoundWithException() { FileLocator locator = new FileLocator(); locator.Add("testdir/A"); locator.Add("testdir/B"); locator.Add("testdir/B/C"); locator.Find("5"); }
public void TestNotFoundWithoutException() { FileLocator locator = new FileLocator(); locator.Add("testdir/A"); locator.Add("testdir/B"); locator.Add("testdir/B/C"); string file = locator.Find("5", false); file.Should().Be.Null(); }
public void TestSimpleSearches() { FileLocator locator = new FileLocator(); locator.Add("testdir/A"); locator.Add("testdir/B"); locator.Add("testdir/B/C"); var results = new[] { 1, 2, 3, 4 }.Select(x => locator.Find(x.ToString())).ToArray(); StringAssert.StartsWith("testdir/A", results[0]); StringAssert.StartsWith("testdir/A", results[1]); StringAssert.StartsWith("testdir/B", results[2]); StringAssert.StartsWith("testdir/B/C", results[3]); }