Esempio n. 1
0
        public void When_not_set_as_file_search_it_will_not_find_it()
        {
            var cache = new TypeCache();

            cache.Add(new Project(to("/Some/Path/Project1.cs"), ""));
            cache.Add(toFile("/Some/Path/File2.cs"));

            var verifier = new ResultVerifier(cache.FindFiles("Proj"));

            verifier.VerifyCount(0);
        }
Esempio n. 2
0
        public void When_searching_for_a_project_it_will_return()
        {
            var cache = new TypeCache();

            cache.Add(new Project(to("/Some/Path/Project1.cs"), "").SetFileSearch());
            cache.Add(toFile("/Some/Path/File2.cs").SetFileSearch());

            var verifier = new ResultVerifier(cache.FindFiles("Proj"));

            verifier.VerifyCount(1);
            verifier.Verify(0, FileFindResultType.Project, to("/Some/Path/Project1.cs"));
        }
Esempio n. 3
0
        public void When_searching_for_a_file_it_will_return()
        {
            var cache = new TypeCache();

            cache.Add(toFile("/Some/Path/File1.cs").SetFileSearch());
            cache.Add(toFile("/Some/Path/File2.cs").SetFileSearch());

            var verifier = new ResultVerifier(cache.FindFiles("File1"));

            verifier.VerifyCount(1);
            verifier.Verify(0, FileFindResultType.File, to("/Some/Path/File1.cs"));
        }
Esempio n. 4
0
        public void When_searching_for_a_file_it_will_return_the_files_with_the_lowest_hierarchical_level()
        {
            var cache = new TypeCache();

            cache.Add(toFile("/Some/Path/File1.cs").SetFileSearch());
            cache.Add(toFile("/Some/Path/File2.cs").SetFileSearch());
            cache.Add(toFile("/Some/Path/In/AnotherpathPlace/File2.cs").SetFileSearch());

            var verifier = new ResultVerifier(cache.FindFiles("Path"));

            verifier.VerifyCount(2);
            verifier.Verify(0, FileFindResultType.Directory, to("/Some/Path"));
            verifier.Verify(1, FileFindResultType.Directory, to("/Some/Path/In/AnotherpathPlace"));
        }