예제 #1
0
        public void Init_ProjectKinds()
        {
            using var projectDirectory = CopyTestProjectDirectory("project-types");

            var projectFile = new FileInfo(Path.Combine(projectDirectory.DirectoryPath, "project-types.sln"));

            var(content, _) = InitHost.CreateTyeFileContent(projectFile, force: false);

            var expectedContent = File.ReadAllText("testassets/init/project-types.yaml");

            YamlAssert.Equals(expectedContent, content);
        }
예제 #2
0
        public void Console_Normalization_Service_Name()
        {
            using var projectDirectory = CopyTestProjectDirectory("Console.Normalization.svc.Name");

            var projectFile = new FileInfo(Path.Combine(projectDirectory.DirectoryPath, "Console.Normalization.svc.Name.csproj"));

            var(content, _) = InitHost.CreateTyeFileContent(projectFile, force: false);

            var expectedContent = File.ReadAllText("testassets/init/console-normalization-svc-name.yaml");

            YamlAssert.Equals(expectedContent, content);
        }
예제 #3
0
        public void Init_WorksForMultipleProjects()
        {
            using var projectDirectory = CopyTestProjectDirectory("multi-project");
            File.Delete(Path.Combine(projectDirectory.DirectoryPath, "tye.yaml"));

            var projectFile = new FileInfo(Path.Combine(projectDirectory.DirectoryPath, "multi-project.sln"));

            var(content, _) = InitHost.CreateTyeFileContent(projectFile, force: false);

            var expectedContent = File.ReadAllText("testassets/init/multi-project.yaml");

            YamlAssert.Equals(expectedContent, content);
        }
예제 #4
0
        public void Tye_Init_Force_Works()
        {
            using var projectDirectory = CopyTestProjectDirectory("single-project");
            var tyePath = Path.Combine(projectDirectory.DirectoryPath, "tye.yaml");
            var text    = File.ReadAllText(tyePath);

            File.WriteAllText(tyePath, text + "thisisatest");

            var projectFile = new FileInfo(tyePath);

            var(content, _) = InitHost.CreateTyeFileContent(projectFile, force: true);

            Assert.DoesNotContain("thisisatest", content);
        }
예제 #5
0
        public void SingleProjectInitTest()
        {
            using var projectDirectory = CopySampleProjectDirectory(Path.Combine("single-project", "test-project"));

            File.Delete(Path.Combine(projectDirectory.DirectoryPath, "tye.yaml"));

            var projectFile = new FileInfo(Path.Combine(projectDirectory.DirectoryPath, "test-project.csproj"));

            var(content, _) = InitHost.CreateTyeFileContent(projectFile, force: false);
            var expectedContent = File.ReadAllText("testassets/init/single-project.yaml");

            output.WriteLine(content);

            Assert.Equal(expectedContent.NormalizeNewLines(), content.NormalizeNewLines());
        }
예제 #6
0
        public void Init_WorksForMultipleProjects_FileComparison()
        {
            using var projectDirectory = CopyTestProjectDirectory("frontend-backend");

            // delete already present yaml
            File.Delete(Path.Combine(projectDirectory.DirectoryPath, "tye.yaml"));

            var projectFile = new FileInfo(Path.Combine(projectDirectory.DirectoryPath, "frontend-backend.sln"));

            var(content, _) = InitHost.CreateTyeFileContent(projectFile, force: false);
            var expectedContent = File.ReadAllText("testassets/init/frontend-backend.yaml");

            output.WriteLine(content);

            YamlAssert.Equals(expectedContent, content);
        }
예제 #7
0
        public void Init_ProjectKinds()
        {
            using var projectDirectory = CopyTestProjectDirectory("project-types");

            // delete already present yaml
            File.Delete(Path.Combine(projectDirectory.DirectoryPath, "tye.yaml"));

            var projectFile = new FileInfo(Path.Combine(projectDirectory.DirectoryPath, "project-types.sln"));

            var(content, _) = InitHost.CreateTyeFileContent(projectFile, force: false);
            var expectedContent = File.ReadAllText("testassets/init/project-types.yaml");

            output.WriteLine(content);

            Assert.Equal(expectedContent.NormalizeNewLines(), content.NormalizeNewLines());
        }
예제 #8
0
        public void FrontendBackendTest()
        {
            using var projectDirectory = CopySampleProjectDirectory("frontend-backend");

            // delete already present yaml
            File.Delete(Path.Combine(projectDirectory.DirectoryPath, "tye.yaml"));

            var projectFile = new FileInfo(Path.Combine(projectDirectory.DirectoryPath, "frontend-backend.sln"));

            var(content, _) = InitHost.CreateTyeFileContent(projectFile, force: false);
            var expectedContent = File.ReadAllText("testassets/init/frontend-backend.yaml");

            output.WriteLine(content);

            Assert.Equal(expectedContent.NormalizeNewLines(), content.NormalizeNewLines());
        }
예제 #9
0
        public void SingleProjectInitTest()
        {
            var projectDirectory = new DirectoryInfo(Path.Combine(TestHelpers.GetSolutionRootDirectory("tye"), "samples", "single-project", "test-project"));

            using var tempDirectory = TempDirectory.Create();
            DirectoryCopy.Copy(projectDirectory.FullName, tempDirectory.DirectoryPath);

            File.Delete(Path.Combine(tempDirectory.DirectoryPath, "tye.yaml"));

            var projectFile = new FileInfo(Path.Combine(tempDirectory.DirectoryPath, "test-project.csproj"));

            var(content, _) = InitHost.CreateTyeFileContent(projectFile, force: false);
            var expectedContent = File.ReadAllText("testassets/init/single-project.yaml");

            output.WriteLine(content);

            Assert.Equal(expectedContent.NormalizeNewLines(), content.NormalizeNewLines());
        }
예제 #10
0
        public void FrontendBackendTest()
        {
            var projectDirectory = new DirectoryInfo(Path.Combine(TestHelpers.GetSolutionRootDirectory("tye"), "samples", "frontend-backend"));

            using var tempDirectory = TempDirectory.Create();
            DirectoryCopy.Copy(projectDirectory.FullName, tempDirectory.DirectoryPath);

            // delete already present yaml
            File.Delete(Path.Combine(tempDirectory.DirectoryPath, "tye.yaml"));

            var projectFile = new FileInfo(Path.Combine(tempDirectory.DirectoryPath, "frontend-backend.sln"));

            var(content, _) = InitHost.CreateTyeFileContent(projectFile, force: false);
            var expectedContent = File.ReadAllText("testassets/init/frontend-backend.yaml");

            output.WriteLine(content);

            Assert.Equal(expectedContent.NormalizeNewLines(), content.NormalizeNewLines());
        }