示例#1
0
        public void validate_when_everything_matches()
        {
            var request = new TemplateRequest();

            request.AddTemplate("Simple");

            request.Validate(theTemplates).Any().ShouldBeFalse();

            request.AddProjectRequest(new ProjectRequest("foo", "MvcApp"));

            request.Validate(theTemplates).Any().ShouldBeFalse();

            request.Projects.Single().Alterations.Add("Assets");

            request.AddTestingRequest(new ProjectRequest("foo", "MvcApp", "original"));

            request.Validate(theTemplates).Any().ShouldBeFalse();
        }
示例#2
0
        public void validate_missing_solution_template()
        {
            var request = new TemplateRequest();

            request.AddTemplate("NonExistent");

            var missing = request.Validate(theTemplates).Single();

            missing.Name.ShouldEqual("NonExistent");
            missing.TemplateType.ShouldEqual(TemplateType.Solution);
            missing.ValidChoices.ShouldHaveTheSameElementsAs("Complex", "Simple");
        }
示例#3
0
        public void validate_missing_project_template()
        {
            var request = new TemplateRequest();

            request.AddTemplate("Simple");
            request.AddProjectRequest(new ProjectRequest("foo", "NonExistent"));

            var missing = request.Validate(theTemplates).Single();

            missing.Name.ShouldEqual("NonExistent");
            missing.TemplateType.ShouldEqual(TemplateType.Project);
            missing.ValidChoices.ShouldHaveTheSameElementsAs("MvcApp", "MvcBottle");
        }
示例#4
0
        public void validate_missing_alteration_template()
        {
            var request = new TemplateRequest();

            request.AddTemplate("Simple");
            request.AddProjectRequest(new ProjectRequest("foo", "MvcApp"));
            request.Projects.Last().Alterations.Add("NonExistent");

            var missing = request.Validate(theTemplates).Single();

            missing.Name.ShouldEqual("NonExistent");
            missing.TemplateType.ShouldEqual(TemplateType.Alteration);
            missing.ValidChoices.ShouldHaveTheSameElementsAs("Assets", "HtmlConventions");
        }