public static void FeatureAll(this Maker maker, string @in, string name) { maker.Feature(@in, name, "New", "Crud-New"); maker.Feature(@in, name, "Edit", "Crud-Edit"); maker.Feature(@in, name, "Show", "Crud-Show"); maker.Feature(@in, name, "List", "Crud-List"); }
public static void Scaffold(this Maker maker, string @in, string name) { maker.Feature(@in, name, "New", "Crud-New", withTurboResult: false, withView: false, withFeatureTest: false, withPageTest: false); maker.Feature(@in, name, "Edit", "Crud-Edit", withTurboResult: false); maker.Feature(@in, name, "List", "Crud-List", withTurboResult: false); maker.Feature(@in, name, "Delete", "Crud-Delete", withTurboResult: false, withView: false, withPageTest: false); }
public void Make_feature_for_list() { var m = new Maker(new MiruSolution(_solutionDir)); m.Feature("Goals", "Goal", "List", "List"); (m.Solution.FeaturesDir / "Goals" / "GoalList.cs").ShouldExist(); (m.Solution.FeaturesDir / "Goals" / "List.cshtml").ShouldContain( "<a href=\"#\">Edit</a>"); (m.Solution.AppTestsDir / "Features" / "Goals" / "GoalListTest.cs").ShouldExist(); (m.Solution.AppPageTestsDir / "Pages" / "Goals" / "GoalListPageTest.cs").ShouldExist(); }
public void Make_feature_for_new() { var m = new Maker(new MiruSolution(_solutionDir)); m.Feature("Goals", "Goal", "New", "New"); (m.Solution.FeaturesDir / "Goals" / "GoalNew.cs").ShouldExist(); (m.Solution.FeaturesDir / "Goals" / "New.cshtml").ShouldExist(); (m.Solution.FeaturesDir / "Goals" / "_New.turbo.cshtml").ShouldExist(); (m.Solution.AppTestsDir / "Features" / "Goals" / "GoalNewTest.cs").ShouldExist(); (m.Solution.AppPageTestsDir / "Pages" / "Goals" / "GoalNewPageTest.cs").ShouldExist(); }
public void Make_feature_for_list() { var m = new Maker(new MiruSolution(_solutionDir)); m.Feature("Goals", "Goal", "List", "List"); (m.Solution.FeaturesDir / "Goals" / "GoalList.cs").ShouldExist(); (m.Solution.FeaturesDir / "Goals" / "List.cshtml").ShouldExistAndContains( "<a for=\"@(new GoalEdit.Query { Id = item.Id })\">Edit</a>"); (m.Solution.AppTestsDir / "Features" / "Goals" / "GoalListTest.cs").ShouldExist(); (m.Solution.AppPageTestsDir / "Pages" / "Goals" / "GoalListPageTest.cs").ShouldExist(); }
public void Make_feature_for_show() { // arrange var m = new Maker(new MiruSolution(_solutionDir)); // act m.Feature("Goals", "Goal", "Details", template: "Show"); // assert (m.Solution.FeaturesDir / "Goals" / "GoalDetails.cs").ShouldContain( "public class GoalDetails"); (m.Solution.FeaturesDir / "Goals" / "Details.cshtml").ShouldContain( "<a href=\"#\">Edit</a>"); (m.Solution.AppTestsDir / "Features" / "Goals" / "GoalDetailsTest.cs").ShouldExist(); (m.Solution.AppPageTestsDir / "Pages" / "Goals" / "GoalDetailsPageTest.cs").ShouldExist(); }
public override bool Execute(Input input) { var make = new Maker(_solution); Console2.BreakLine(); if (input.Template.IsEmpty()) { Console2.YellowLine("Choose one of the templates passing the flag:"); Console2.WhiteLine("--new"); Console2.WhiteLine("--show"); Console2.WhiteLine("--list"); Console2.WhiteLine("--edit"); return(false); } make.Feature(input.In, input.Name, input.Action, input.Template); Console2.BreakLine(); return(true); }