示例#1
0
        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 TestNotFoundWithException()
        {
            FileLocator locator = new FileLocator();

            locator.Add("testdir/A");
            locator.Add("testdir/B");
            locator.Add("testdir/B/C");

            locator.Find("5");
        }
示例#3
0
        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 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();
        }
示例#5
0
        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]);
        }
        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]);
        }