public void choose_the_floating_edge_feed_by_flag()
        {
            var input = new NewCommandInput
            {
                FloatingFlag = true
            };

            input.RippleFlag.ShouldEqual(FeedChoice.FloatingEdge);
        }
Beispiel #2
0
        public void solution_path_is_just_current_plus_solution_name_by_default()
        {
            var input = new NewCommandInput
            {
                SolutionName = "MySolution"
            };

            input.SolutionDirectory().ToFullPath()
                 .ShouldEqual(Environment.CurrentDirectory.AppendPath("MySolution").ToFullPath());
        }
Beispiel #3
0
        public void add_no_views_home_page_if_there_are_no_views()
        {
            var input = new NewCommandInput
            {
                SolutionName = "FubuMVC.Scenarios",
                AppFlag = true,
            };

            var request = NewCommand.BuildTemplateRequest(input);
            request.Projects.Single().Alterations.ShouldContain("no-views");
        }
Beispiel #4
0
        public void no_project_if_profile_is_empty()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
                RippleFlag = FeedChoice.Edge,
                Profile = "empty"
            };

            TemplateRequest request = input.CreateRequestForSolution();

            request.Projects.Any().ShouldBeFalse();
        }
Beispiel #5
0
        public void add_spark_but_not_no_views_if_spark_option_is_requested()
        {
            var input = new NewCommandInput
            {
                SolutionName = "FubuMVC.Scenarios",
                AppFlag = true,
                OptionsFlag = new string[]{"spark"}
            };

            var request = NewCommand.BuildTemplateRequest(input);
            request.Projects.Single().Alterations.ShouldNotContain("no-views");
            request.Projects.Single().Alterations.ShouldContain("spark");
        }
Beispiel #6
0
        public void default_ripple_is_public_only()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
            };

            TemplateRequest request = input.CreateRequestForSolution();

            request.Templates.ShouldContain("public-ripple");
            request.Templates.ShouldNotContain("edge-ripple");
            request.Templates.ShouldNotContain("floating-ripple");
        }
        public void choose_the_public_ripple()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
                RippleFlag = FeedChoice.PublicOnly
            };

            var request = input.CreateRequestForSolution();

            request.Templates.ShouldContain("public-ripple");
            request.Templates.ShouldNotContain("edge-ripple");
            request.Templates.ShouldNotContain("floating-ripple");
        }
Beispiel #8
0
        public void adds_in_the_testing_request_if_app_and_tests_are_selected()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
                AppFlag = true,
                TestsFlag = true
            };

            var request = NewCommand.BuildTemplateRequest(input);
            var testingRequest = request.TestingProjects.Single();

            testingRequest.ShouldNotBeNull();
            testingRequest.OriginalProject.ShouldEqual("NewThing");
            testingRequest.Name.ShouldEqual("NewThing.Testing");
            testingRequest.Template.ShouldEqual("baseline");

            testingRequest.Alterations.Single().ShouldEqual("unit-testing");
        }
Beispiel #9
0
        public void SetUp()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
                Profile = "web-app",
            };

            TemplateRequest request = input.CreateRequestForSolution();

            project = request.Projects.Single();
        }
        public void no_profile_adds_a_web_app_project_and_tests()
        {
            var input = new NewCommandInput
            {
                SolutionName = "MyCompany.NewThing",
                RippleFlag = FeedChoice.Edge,
                ShortNameFlag = "NewThang",
            };

            var request = input.CreateRequestForSolution();
            request.Projects.Any().ShouldBeTrue();
            request.TestingProjects.Any().ShouldBeTrue();
        }
Beispiel #11
0
        public void no_project_if_app_flag_is_false()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
                RippleFlag = FeedChoice.Edge
            };

            input.AppFlag.ShouldBeFalse();

            var request = NewCommand.BuildTemplateRequest(input);

            request.Projects.Any().ShouldBeFalse();
        }
        public void to_template_choices_basics()
        {
            var input = new NewCommandInput
            {
                SolutionName = "MyCompany.NewThing",
                RippleFlag = FeedChoice.Edge,
                ShortNameFlag = "NewThang",
                NoTestsFlag = true,
                OptionsFlag = new string[]{"a", "b", "c"}
            };

            var choices = input.ToTemplateChoices();
            choices.Category.ShouldEqual("new");
            choices.ProjectName.ShouldEqual(input.SolutionName);
            choices.ProjectType.ShouldEqual(input.Profile);
            choices.Options.ShouldHaveTheSameElementsAs("a", "b", "c");
        }
        public void sets_the_short_name_of_the_project_by_explicit_flag()
        {
            var input = new NewCommandInput
            {
                SolutionName = "MyCompany.NewThing",
                RippleFlag = FeedChoice.Edge,
                ShortNameFlag = "NewThang"
            };

            var request = input.CreateRequestForSolution();

            request.Substitutions.ValueFor(ProjectPlan.SHORT_NAME)
                .ShouldEqual("NewThang");
        }
        public void sets_the_dot_net_version()
        {
            var input = new NewCommandInput
            {
                SolutionName = "MyCompany.NewThing",
                RippleFlag = FeedChoice.Edge,
                DotNetFlag = DotNetVersion.V45
            };

            var request = input.CreateRequestForSolution();

            request.Projects.First()
                .Version.ShouldEqual(input.DotNetFlag);

            request.TestingProjects.First()
                .Version.ShouldEqual(input.DotNetFlag);
        }
        public void profile_is_empty_no_project_requests()
        {
            var input = new NewCommandInput
            {
                SolutionName = "MyCompany.NewThing",
                RippleFlag = FeedChoice.Edge,
                ShortNameFlag = "NewThang",
                Profile = "empty"
            };

            var request = input.CreateRequestForSolution();
            request.Projects.Any().ShouldBeFalse();
        }
Beispiel #16
0
        public void new_project_request_gets_the_assembly_version_alteration()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
                AppFlag = true
            };

            var request = NewCommand.BuildTemplateRequest(input);
            request.Projects.Single().Template.ShouldContain("baseline");
        }
Beispiel #17
0
        public void choose_the_edge_ripple()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
                RippleFlag = FeedChoice.Edge
            };

            var request = NewCommand.BuildTemplateRequest(input);

            request.Templates.ShouldNotContain("public-ripple");
            request.Templates.ShouldContain("edge-ripple");
            request.Templates.ShouldNotContain("floating-ripple");
        }
Beispiel #18
0
        public void no_tests_if_no_tests_flag()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
                AppFlag = true,
                TestsFlag = false
            };

            var request = NewCommand.BuildTemplateRequest(input);
            request.TestingProjects.Any().ShouldBeFalse();
        }
Beispiel #19
0
        public void SetUp()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
                AppFlag = true
            };

            var request = NewCommand.BuildTemplateRequest(input);

            project = request.Projects.Single();
        }
Beispiel #20
0
        public void supports_the_shortname_flag()
        {
            var input = new NewCommandInput
            {
                SolutionName = "FubuMVC.Scenarios",
                AppFlag = true,
                ShortNameFlag = "Foo"
            };

            var request = NewCommand.BuildTemplateRequest(input);

            request.Projects.Single().Substitutions.ValueFor(ProjectPlan.SHORT_NAME).ShouldEqual("Foo");
        }
        public void no_tests_if_no_tests_flag_is_selected()
        {
            var input = new NewCommandInput
            {
                SolutionName = "MyCompany.NewThing",
                RippleFlag = FeedChoice.Edge,
                ShortNameFlag = "NewThang",
                NoTestsFlag = true
            };

            var request = input.CreateRequestForSolution();
            request.Projects.Any().ShouldBeTrue();
            request.TestingProjects.Any().ShouldBeFalse();
        }
Beispiel #22
0
        public void default_ripple_is_public_only()
        {
            var input = new NewCommandInput
            {
                SolutionName = "NewThing",
            };

            var request = NewCommand.BuildTemplateRequest(input);

            request.Templates.ShouldContain("public-ripple");
            request.Templates.ShouldNotContain("edge-ripple");
            request.Templates.ShouldNotContain("floating-ripple");
        }