public void Make_a_command() { // arrange var m = new Maker(new MiruSolution(_solutionDir)); // act m.Command("Carts", "Cart", "New"); // assert (m.Solution.FeaturesDir / "Carts" / "CartNew.cs") .ShouldContain( "namespace Shopifu.Features.Carts", "public class CartNew"); (m.Solution.FeaturesDir / "Carts" / "New.cshtml") .ShouldContain( "@model CartNew.Command"); (m.Solution.FeaturesDir / "Carts" / "_New.turbo.cshtml").ShouldExist(); (m.Solution.AppTestsDir / "Features" / "Carts" / "CartNewTest.cs").ShouldExist(); (m.Solution.AppPageTestsDir / "Pages" / "Carts" / "CartNewPageTest.cs") .ShouldContain( "namespace Shopifu.PageTests.Pages.Carts", "public class CartNewPageTest : PageTest"); }
public override bool Execute(Input input) { var make = new Maker(_solution); Console2.BreakLine(); make.Command(input.In, input.Name, input.Action); return(true); }
public async Task Execute() { var make = new Maker(_solution); Console2.BreakLine(); make.Command(In, Name, Action); Console2.BreakLine(); await Task.CompletedTask; }
public void Make_a_command_in_sub_folders() { // arrange var m = new Maker(new MiruSolution(_solutionDir)); // act m.Command("Admin/Catalogue/Products", "Product", "New"); // assert (m.Solution.FeaturesDir / "Admin" / "Catalogue" / "Products" / "ProductNew.cs") .ShouldContain( "namespace Shopifu.Features.Admin.Catalogue.Products", "public class ProductNew"); }
public void Make_a_command_in_sub_folders() { // arrange var m = new Maker(new MiruSolution(_solutionDir)); // act m.Command("Admin/Catalogue/Products", "Product", "New"); // assert (m.Solution.FeaturesDir / "Admin" / "Catalogue" / "Products" / "ProductNew.cs") .ShouldContain( "namespace Shopifu.Features.Admin.Catalogue.Products", "public class ProductNew", "public class ProductsController", "[HttpGet(\"/Admin/Catalogue/Products/New\")]", "[HttpPost(\"/Admin/Catalogue/Products/New\")]"); (m.Solution.AppPageTestsDir / "Admin" / "Catalogue" / "Products" / "ProductNew.cs") .ShouldContain( "namespace Shopifu.PageTests.Pages.Admin.Catalogue.Products", "public class UserRegisterPageTest", "public void Can_register_users_invitations"); }