Exemple #1
0
        public void matches_when_ripple_config_is_found()
        {
            using (var sandbox = DirectorySandbox.Create())
            {
                sandbox.StopAtParent();
                sandbox.CreateFile("ripple.config");

                new DetectRippleConfig()
                .Matches(new FileSystem(), sandbox.Directory)
                .ShouldBeTrue();
            }
        }
Exemple #2
0
        public void loads_the_solution_name()
        {
            using (var sandbox = DirectorySandbox.Create())
            {
                sandbox.CreateDirectory("SourceFolder");
                sandbox.CreateFile("SourceFolder", "Test.sln");

                var solution = theLoader.LoadFrom(new FileSystem(), sandbox.FindFile("ripple.config"));
                solution.Feeds.ShouldHaveTheSameElementsAs(Feed.NuGetV2);
                solution.Name.ShouldEqual("Test");
            }
        }
Exemple #3
0
        public void matches_when_a_packages_config_is_found()
        {
            using (var sandbox = DirectorySandbox.Create())
            {
                sandbox.CreateDirectory("src", "MyProject");
                sandbox.CreateFile("src", "MyProject", "packages.config");

                new DetectPackagesConfig()
                .Matches(new FileSystem(), sandbox.Directory)
                .ShouldBeTrue();
            }
        }
Exemple #4
0
        public void no_match_when_no_packages_config_is_found()
        {
            using (var sandbox = DirectorySandbox.Create())
            {
                sandbox.CreateDirectory("src", "MyProject");
                sandbox.CreateFile("src", "MyProject", "something-else.config");

                new DetectPackagesConfig()
                .Matches(new FileSystem(), sandbox.Directory)
                .ShouldBeFalse();
            }
        }
Exemple #5
0
        public void matches_when_a_single_sln_file_is_found()
        {
            using (var sandbox = DirectorySandbox.Create())
            {
                sandbox.CreateDirectory("src");
                sandbox.CreateFile("src", "Test.sln");

                new DetectSingleSolution()
                .Matches(new FileSystem(), sandbox.Directory)
                .ShouldBeTrue();
            }
        }
        public void no_match_when_no_ripple_dependencies_config_is_found()
        {
            using (var sandbox = DirectorySandbox.Create())
            {
                sandbox.CreateDirectory("src", "MyProject");
                sandbox.CreateFile("src", "MyProject", "packages.config");

                new DetectRippleDependencies()
                .Matches(new FileSystem(), sandbox.Directory)
                .ShouldBeFalse();
            }
        }
Exemple #7
0
        public void no_match_when_multiple_sln_files_are_found()
        {
            using (var sandbox = DirectorySandbox.Create())
            {
                sandbox.CreateDirectory("src");
                sandbox.CreateFile("src", "Test1.sln");
                sandbox.CreateFile("src", "Test2.sln");

                new DetectSingleSolution()
                .Matches(new FileSystem(), sandbox.Directory)
                .ShouldBeFalse();
            }
        }
        public void files_for_nuget_solution()
        {
            using (var sandbox = DirectorySandbox.Create())
            {
                sandbox.CreateFile("MySolution.sln");
                sandbox.CreateDirectory("MyProject");
                sandbox.CreateFile("MyProject", "MyProject.csproj");
                sandbox.CreateFile("MyProject", "packages.config");

                SolutionFiles
                .FromDirectory(sandbox.Directory)
                .Loader
                .ShouldBeOfType <NuGetSolutionLoader>();
            }
        }
        public void files_for_empty_xml_ripple_solution()
        {
            using (var sandbox = DirectorySandbox.Create())
            {
                sandbox.StopAtParent();

                sandbox.CreateXmlFile("ripple.config");

                sandbox.CreateDirectory("src");
                sandbox.CreateFile("src", "MySolution.sln");

                sandbox.CreateDirectory("src", "MyProject");
                sandbox.CreateFile("src", "MyProject", "MyProject.csproj");

                SolutionFiles
                .FromDirectory(sandbox.Directory)
                .Loader
                .ShouldBeOfType <XmlSolutionLoader>();
            }
        }