예제 #1
0
 private static void EditDbContext(MiruPath solutionDir)
 {
     ReplaceFileContent(
         solutionDir / "src" / "Supportreon" / "Database" / "SupportreonDbContext.cs",
         "// Your entities",
         $"// Your entities{Environment.NewLine}\t\tpublic DbSet<Project> Projects {{ get; set; }}");
 }
예제 #2
0
        public void Setup()
        {
            _solutionDir = A.TempPath / "Miru" / "Pantanal";

            Console.WriteLine(_solutionDir);

            Directories.DeleteIfExists(_solutionDir);
        }
예제 #3
0
        // [TearDown]
        public void Setup()
        {
            _solutionDir = A.TempPath("Miru", "Contoso.University");

            Console.WriteLine(_solutionDir);

            Directories.DeleteIfExists(_solutionDir);
        }
예제 #4
0
        public TestNewSolutionCommand() : base(name: "test-new-solution")
        {
            _workingDir     = A.TempPath / BasePath;
            _newSolutionDir = _workingDir / SolutionName;
            _sampleMongDir  = new SolutionFinder().FromCurrentDir().Solution.RootDir / "samples" / SolutionName;

            Handler = CommandHandler.Create(Execute);
        }
예제 #5
0
        public static async Task PutBase64Async(this IStorage storage, MiruPath remotePath, string base64)
        {
            var data = System.Convert.FromBase64String(base64);

            await using var stream = new MemoryStream(data);

            await storage.PutAsync(remotePath, stream);
        }
예제 #6
0
파일: FtpStorage.cs 프로젝트: MiruFx/Miru
        public async Task PutAsync(MiruPath remotePath, Stream stream)
        {
            await EnsureClientIsConnectedAsync();

            Miru.App.Log.Information($"FtpStorage: Saving stream into {App / remotePath}");

            await _client.UploadAsync(stream, App / remotePath, FtpRemoteExists.Overwrite, createRemoteDir : true);
        }
예제 #7
0
 private static void ThrowIfNewDirectoryExist(MiruPath newSolutionDir)
 {
     if (Directory.Exists(newSolutionDir))
     {
         throw new MakeException(
                   $"Can't create new Miru solution. Directory {newSolutionDir} already exist");
     }
 }
예제 #8
0
        public void Setup()
        {
            _solutionDir = A.TempPath("Miru", "Shopifu");

            Console.WriteLine(_solutionDir);

            Directories.DeleteIfExists(_solutionDir);
        }
예제 #9
0
        public async Task PutAsync(MiruPath remote, MiruPath source)
        {
            var fullRemoteDir = App / remote;

            fullRemoteDir.Dir().EnsureDirExist();

            File.Copy(source, fullRemoteDir, true);

            await Task.CompletedTask;
        }
예제 #10
0
        public static FormFile FormFile(this ITestFixture fixture, MiruPath path, string contentType)
        {
            var stream = File.OpenRead(path);

            var file = new FormFile(stream, 0, stream.Length, null, Path.GetFileName(path))
            {
                Headers     = new HeaderDictionary(),
                ContentType = contentType
            };

            return(file);
        }
예제 #11
0
파일: FtpStorage.cs 프로젝트: MiruFx/Miru
        public async Task <Stream> GetAsync(MiruPath remotePath)
        {
            await EnsureClientIsConnectedAsync();

            Miru.App.Log.Information($"FtpStorage: Reading stream from {App / remotePath}");

            var stream = new MemoryStream();

            await _client.DownloadAsync(stream, App / remotePath);

            return(stream);
        }
예제 #12
0
    public static void ShouldContain(this MiruPath fileName, params string[] lines)
    {
        var file = File.ReadAllText(fileName);

        try
        {
            lines.Each(line => file.ShouldContain(line));
        }
        catch (Exception)
        {
            Console.WriteLine(file);
            throw;
        }
    }
예제 #13
0
        public void Setup()
        {
            _tempDir = A.TempPath("Miru", "SolutionFinderTest");

            Directories.DeleteIfExists(_tempDir);

            var maker = Maker.For(_tempDir, "Shoppers");

            maker.New("Shoppers");

            _solutionDir = _tempDir / "Shoppers";

            _solution = _solutionFinder.FromDir(_solutionDir).Solution;
        }
예제 #14
0
        public async Task PutAsync(MiruPath remote, Stream stream)
        {
            var fullRemoteDir = App / remote;

            Files.DeleteIfExists(fullRemoteDir);

            fullRemoteDir.Dir().EnsureDirExist();

            await using var fileStream = File.Create(fullRemoteDir);

            stream.Seek(0, SeekOrigin.Begin);

            await stream.CopyToAsync(fileStream);

            fileStream.Close();
        }
예제 #15
0
파일: FtpStorage.cs 프로젝트: MiruFx/Miru
        public async Task <bool> FileExistsAsync(MiruPath remote)
        {
            await EnsureClientIsConnectedAsync();

            return(await _client.FileExistsAsync(App / remote));
        }
예제 #16
0
 public async Task <Stream> GetAsync(MiruPath remote)
 {
     return(await Task.FromResult(File.OpenRead(App / remote)));
 }
예제 #17
0
파일: FtpStorage.cs 프로젝트: MiruFx/Miru
        public async Task PutAsync(MiruPath remotePath, MiruPath sourcePath)
        {
            await EnsureClientIsConnectedAsync();

            await _client.UploadFileAsync(sourcePath, App / remotePath, FtpRemoteExists.Overwrite, createRemoteDir : true);
        }
예제 #18
0
    public void Setup()
    {
        _solutionDir = A.TempPath / "Miru" / "Shopifu";

        Directories.DeleteIfExists(_solutionDir);
    }
예제 #19
0
        public void Setup()
        {
            _solutionDir = A.TempPath("Miru", "Mong");

            Directories.DeleteIfExists(_solutionDir);
        }
예제 #20
0
 public async Task <bool> FileExistsAsync(MiruPath remote)
 {
     return(await Task.FromResult(File.Exists(App / remote)));
 }
예제 #21
0
        public static async Task <string> GetBase64Async(this IStorage storage, MiruPath remotePath)
        {
            await using var stream = await storage.GetAsync(remotePath);

            return(System.Convert.ToBase64String(stream.ToBytes()));
        }
예제 #22
0
        public static void Export()
        {
            _rootDir = new SolutionFinder().FromCurrentDir().Solution.RootDir;
            _dir     = _rootDir / "samples" / "Skeleton";
            _stubDir = _rootDir / "src" / "Miru.Core" / "Templates";

            Directories.DeleteIfExists(_stubDir);
            Directory.CreateDirectory(_stubDir);

            // New
            ExportFile(_dir / "Skeleton.sln", "Solution.sln");
            ExportFile(_dir / "gitignore", ".gitignore", destinationFile: ".gitignore");
            ExportFile(_dir / "nuget.config");
            ExportFile(_dir / "global.json");

            ExportDir(_dir / "config");

            ExportFile(_dir / "src" / "Skeleton" / "webpack.mix.js");
            ExportFile(_dir / "src" / "Skeleton" / "Startup.cs");
            ExportFile(_dir / "src" / "Skeleton" / "Skeleton.csproj");
            ExportFile(_dir / "src" / "Skeleton" / "Program.cs");
            ExportFile(_dir / "src" / "Skeleton" / "package.json");

            ExportDir(_dir / "src" / "Skeleton" / "Config");
            ExportFile(_dir / "src" / "Skeleton" / "Database" / "Migrations" / "202006101850_CreateUsers.cs");
            ExportFile(_dir / "src" / "Skeleton" / "Database" / "SkeletonDbContext.cs");
            ExportFile(_dir / "src" / "Skeleton" / "Domain" / "User.cs");

            ExportFile(_dir / "src" / "Skeleton" / "Features" / "_ViewImports.cshtml");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "_ViewStart.cshtml");
            ExportDir(_dir / "src" / "Skeleton" / "Features" / "Accounts");
            ExportDir(_dir / "src" / "Skeleton" / "Features" / "Home");
            ExportDir(_dir / "src" / "Skeleton" / "Features" / "Shared");
            ExportDir(_dir / "src" / "Skeleton" / "resources");

            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Skeleton.Tests.csproj");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "SkeletonFabricator.cs");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Program.cs", "'Program");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Extensions.cs");
            ExportDir(_dir / "tests" / "Skeleton.Tests" / "Features" / "Accounts");
            ExportDir(_dir / "tests" / "Skeleton.Tests" / "Features" / "Home");
            ExportDir(_dir / "tests" / "Skeleton.Tests" / "Config");

            ExportFile(_dir / "tests" / "Skeleton.PageTests" / "Skeleton.PageTests.csproj");
            ExportFile(_dir / "tests" / "Skeleton.PageTests" / "Program.cs", "''Program");
            ExportDir(_dir / "tests" / "Skeleton.PageTests" / "Pages" / "Accounts");
            ExportDir(_dir / "tests" / "Skeleton.PageTests" / "Pages" / "Home");
            ExportDir(_dir / "tests" / "Skeleton.PageTests" / "Config");

            SaveMapForNewSolution();

            // Command
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "ProductEdit.cs", "Command", "Edit");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "Edit.cshtml", "Command.cshtml", "Edit");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "_Edit.js.cshtml", "_Command.js.cshtml", "Edit");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Features" / "Products" / "ProductEditTest.cs", "CommandTest", "Edit");
            ExportFile(_dir / "tests" / "Skeleton.PageTests" / "Pages" / "Products" / "ProductEditPageTest.cs", "CommandPageTest", "Edit");

            // Query
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "ProductList.cs", "Query", "List");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "List.cshtml", "Query.cshtml", "List");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Features" / "Products" / "ProductListTest.cs", "QueryTest", "List");
            ExportFile(_dir / "tests" / "Skeleton.PageTests" / "Pages" / "Products" / "ProductListPageTest.cs", "QueryPageTest", "List");

            // Migration
            ExportFile(_dir / "src" / "Skeleton" / "Database" / "Migrations" / "999999999999_CreateCards.cs", "Migration");

            // Entity
            ExportFile(_dir / "src" / "Skeleton" / "Domain" / "Product.cs", "Entity");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Domain" / "ProductTest.cs", "EntityTest");

            // Consolable
            ExportFile(_dir / "src" / "Skeleton" / "Consolables" / "SeedConsolable.cs", "Consolable");

            // Job
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "ProductCreated.cs", "Job", templateKey: "Job");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Features" / "Products" / "ProductCreatedTest.cs", "JobTest", templateKey: "Job");

            // Email
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "ProductCreatedMail.cs", "Mailable", templateKey: "Email");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "ProductCreatedMail.cshtml", "MailTemplate", templateKey: "Email");

            // Config
            ExportFile(_dir / "config" / "_Config.Example.yml", "Config");

            // Feature-New
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "ProductNew.cs", "New-Feature");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "New.cshtml", "New-Feature.cshtml");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "_New.js.cshtml", "New-_Feature.js.cshtml");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Features" / "Products" / "ProductNewTest.cs", "New-FeatureTest");
            ExportFile(_dir / "tests" / "Skeleton.PageTests" / "Pages" / "Products" / "ProductNewPageTest.cs", "New-FeaturePageTest");

            // Feature-Edit
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "ProductEdit.cs", "Edit-Feature", templateKey: "Edit");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "Edit.cshtml", "Edit-Feature.cshtml", templateKey: "Edit");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "_Edit.js.cshtml", "Edit-_Feature.js.cshtml", templateKey: "Edit");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Features" / "Products" / "ProductEditTest.cs", "Edit-FeatureTest", templateKey: "Edit");
            ExportFile(_dir / "tests" / "Skeleton.PageTests" / "Pages" / "Products" / "ProductEditPageTest.cs", "Edit-FeaturePageTest", templateKey: "Edit");

            // Feature-Show
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "ProductShow.cs", "Show-Feature", templateKey: "Show");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "Show.cshtml", "Show-Feature.cshtml", templateKey: "Show");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Features" / "Products" / "ProductShowTest.cs", "Show-FeatureTest", templateKey: "Show");
            ExportFile(_dir / "tests" / "Skeleton.PageTests" / "Pages" / "Products" / "ProductShowPageTest.cs", "Show-FeaturePageTest", templateKey: "Show");

            // Feature-List
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "ProductList.cs", "List-Feature", templateKey: "List");
            ExportFile(_dir / "src" / "Skeleton" / "Features" / "Products" / "List.cshtml", "List-Feature.cshtml", templateKey: "List");
            ExportFile(_dir / "tests" / "Skeleton.Tests" / "Features" / "Products" / "ProductListTest.cs", "List-FeatureTest", templateKey: "List");
            ExportFile(_dir / "tests" / "Skeleton.PageTests" / "Pages" / "Products" / "ProductListPageTest.cs", "List-FeaturePageTest", templateKey: "List");
        }
예제 #23
0
        private static void EditMigrationCreateProject(MiruPath solutionDir)
        {
            var file = FindFile(solutionDir / "src" / "Supportreon" / "Database" / "Migrations", "*_CreateProjects.cs");

            ReplaceFileContent(file, "TableName", "Projects");
        }
예제 #24
0
        //[TearDown]
        public void Setup()
        {
            _tempDir = A.TempPath("Miru");

            Directories.DeleteIfExists(_tempDir);
        }
예제 #25
0
        public static void Export()
        {
            _rootDir = new SolutionFinder().FromCurrentDir().Solution.RootDir;
            _dir     = _rootDir / "samples" / "Corpo.Skeleton";
            _stubDir = _rootDir / "src" / "Miru.Core" / "Templates";

            Directories.DeleteIfExists(_stubDir);
            Directory.CreateDirectory(_stubDir);

            // FIXME: use Solution to build the artifacts' path

            // New
            ExportFile(_dir / "Corpo.Skeleton.sln", "Solution.sln");
            ExportFile(_dir / "gitignore", ".gitignore", destinationFile: ".gitignore");
            ExportFile(_dir / "README.md");

            ExportFile(_dir / "src" / "Corpo.Skeleton" / "webpack.mix.js");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Startup.cs");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Corpo.Skeleton.csproj");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Program.cs");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "package.json");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "appSettings-example.yml");

            ExportDir(_dir / "src" / "Corpo.Skeleton" / "Config");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Database" / "Migrations" / "202001290120_CreateUserfy.cs");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Database" / "SkeletonDbContext.cs");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Domain" / "User.cs");

            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "_ViewImports.cshtml");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "_ViewStart.cshtml");
            ExportDir(_dir / "src" / "Corpo.Skeleton" / "Features" / "Accounts");
            ExportDir(_dir / "src" / "Corpo.Skeleton" / "Features" / "Home");
            ExportDir(_dir / "src" / "Corpo.Skeleton" / "Features" / "Shared");
            ExportDir(_dir / "src" / "Corpo.Skeleton" / "resources");

            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Corpo.Skeleton.Tests.csproj");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "SkeletonFabricator.cs");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Program.cs", "'Program");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Extensions.cs");
            ExportDir(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Accounts");
            ExportDir(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Home");
            ExportDir(_dir / "tests" / "Corpo.Skeleton.Tests" / "Config");

            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Corpo.Skeleton.PageTests.csproj");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Program.cs", "''Program");
            ExportDir(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Accounts");
            ExportDir(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Home");
            ExportDir(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Config");

            SaveMapForNewSolution();

            // Command
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Tickets" / "TicketEdit.cs", "Command", "Edit");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Tickets" / "Edit.cshtml", "Command.cshtml", "Edit");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Tickets" / "_Edit.turbo.cshtml", "_Command.turbo.cshtml", "Edit");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Tickets" / "TicketEditTest.cs", "CommandTest", "Edit");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Tickets" / "TicketEditPageTest.cs", "CommandPageTest", "Edit");

            // Query
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Tickets" / "TicketShow.cs", "Query", "Show");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Tickets" / "Show.cshtml", "Query.cshtml", "Show");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Tickets" / "TicketShowTest.cs", "QueryTest", "Show");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Tickets" / "TicketShowPageTest.cs", "QueryPageTest", "Show");

            // Migration
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Database" / "Migrations" / "999999999999_CreateCards.cs", "Migration");

            // Entity
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Domain" / "Team.cs", "Entity");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Domain" / "TeamTest.cs", "EntityTest");

            // Consolable
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Consolables" / "SeedConsolable.cs", "Consolable");

            // Job
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "TeamCreated.cs", "Job", templateKey: "Job");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Teams" / "TeamCreatedTest.cs", "JobTest", templateKey: "Job");

            // Email
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "TeamCreatedMail.cs", "Mailable", templateKey: "Email");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "_Created.mail.cshtml", "MailTemplate", templateKey: "Email");

            // Config
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "appSettings-example.yml", "AppSettings");

            // Feature-New
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Categories" / "CategoryNew.cs", "New-Feature");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Categories" / "New.cshtml", "New-Feature.cshtml");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Categories" / "_New.turbo.cshtml", "New-_Feature.turbo.cshtml");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Categories" / "CategoryNewTest.cs", "New-FeatureTest");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Categories" / "CategoryNewPageTest.cs", "New-FeaturePageTest");

            // Feature-Edit
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Categories" / "CategoryEdit.cs", "Edit-Feature", templateKey: "Edit");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Categories" / "Edit.cshtml", "Edit-Feature.cshtml", templateKey: "Edit");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Categories" / "_Edit.turbo.cshtml", "Edit-_Feature.turbo.cshtml", templateKey: "Edit");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Categories" / "CategoryEditTest.cs", "Edit-FeatureTest", templateKey: "Edit");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Categories" / "CategoryEditPageTest.cs", "Edit-FeaturePageTest", templateKey: "Edit");

            // Feature-Show
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Categories" / "CategoryShow.cs", "Show-Feature", templateKey: "Show");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Categories" / "Show.cshtml", "Show-Feature.cshtml", templateKey: "Show");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Categories" / "CategoryShowTest.cs", "Show-FeatureTest", templateKey: "Show");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Categories" / "CategoryShowPageTest.cs", "Show-FeaturePageTest", templateKey: "Show");

            // Feature-List
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Categories" / "CategoryList.cs", "List-Feature", templateKey: "List");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Categories" / "List.cshtml", "List-Feature.cshtml", templateKey: "List");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Categories" / "CategoryListTest.cs", "List-FeatureTest", templateKey: "List");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Categories" / "CategoryListPageTest.cs", "List-FeaturePageTest", templateKey: "List");

            // Feature-Crud
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "TeamNew.cs", "Crud-New-Feature");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "New.cshtml", "Crud-New-Feature.cshtml");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "_New.turbo.cshtml", "Crud-New-_Feature.turbo.cshtml");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Teams" / "TeamNewTest.cs", "Crud-New-FeatureTest");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Teams" / "TeamNewPageTest.cs", "Crud-New-FeaturePageTest");

            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "TeamEdit.cs", "Crud-Edit-Feature", templateKey: "Edit");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "Edit.cshtml", "Crud-Edit-Feature.cshtml", templateKey: "Edit");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "_Edit.turbo.cshtml", "Crud-Edit-_Feature.turbo.cshtml", templateKey: "Edit");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Teams" / "TeamEditTest.cs", "Crud-Edit-FeatureTest", templateKey: "Edit");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Teams" / "TeamEditPageTest.cs", "Crud-Edit-FeaturePageTest", templateKey: "Edit");

            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "TeamShow.cs", "Crud-Show-Feature", templateKey: "Show");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "Show.cshtml", "Crud-Show-Feature.cshtml", templateKey: "Show");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Teams" / "TeamShowTest.cs", "Crud-Show-FeatureTest", templateKey: "Show");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Teams" / "TeamShowPageTest.cs", "Crud-Show-FeaturePageTest", templateKey: "Show");

            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "TeamList.cs", "Crud-List-Feature", templateKey: "List");
            ExportFile(_dir / "src" / "Corpo.Skeleton" / "Features" / "Teams" / "List.cshtml", "Crud-List-Feature.cshtml", templateKey: "List");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.Tests" / "Features" / "Teams" / "TeamListTest.cs", "Crud-List-FeatureTest", templateKey: "List");
            ExportFile(_dir / "tests" / "Corpo.Skeleton.PageTests" / "Pages" / "Teams" / "TeamListPageTest.cs", "Crud-List-FeaturePageTest", templateKey: "List");
        }
예제 #26
0
        public static void ShouldContain(this MiruPath fileName, params string[] lines)
        {
            var file = File.ReadAllText(fileName);

            lines.Each(line => file.ShouldContain(line));
        }
예제 #27
0
 public static void ShouldExist(this MiruPath fileName)
 {
     File.Exists(fileName).ShouldBeTrue($"File {fileName} should exist but doesn't");
 }
예제 #28
0
        private static void CreateDirectoryForPath(MiruPath file)
        {
            var dir = Path.GetDirectoryName(file);

            Directories.CreateIfNotExists(dir);
        }