Beispiel #1
0
        public void FailWhenNoRestoreTest()
        {
            TestInstance instance = TestAssetsManager.CreateTestInstance("TestAppWithLibrary");

            string testProject    = _getProjectJson(instance.TestRoot, "TestApp");
            var    publishCommand = new PublishCommand(testProject);

            publishCommand.ExecuteWithCapturedOutput().Should().Fail();
        }
Beispiel #2
0
        public void PublishFailsWhenProjectNotBuiltAndNoBuildFlagSet()
        {
            TestInstance instance = TestAssetsManager.CreateTestInstance("TestAppCompilationContext")
                                    .WithLockFiles();

            var testProject    = _getProjectJson(instance.TestRoot, "TestApp");
            var publishCommand = new PublishCommand(testProject, noBuild: true);

            publishCommand.ExecuteWithCapturedOutput().Should().Fail();
        }
Beispiel #3
0
        public void CompilationFailedTest()
        {
            TestInstance instance = TestAssetsManager.CreateTestInstance("CompileFail")
                                    .WithLockFiles();

            var testProject    = _getProjectJson(instance.TestRoot, "CompileFail");
            var publishCommand = new PublishCommand(testProject);

            publishCommand.ExecuteWithCapturedOutput().Should().Fail();
        }
Beispiel #4
0
        public void PublishedLibraryWithoutRIDShouldFail()
        {
            TestInstance instance = TestAssetsManager.CreateTestInstance(Path.Combine("TestAppWithLibrary"))
                                    .WithLockFiles();

            var testProject    = _getProjectJson(instance.TestRoot, "TestLibrary");
            var publishCommand = new PublishCommand(testProject);

            publishCommand.ExecuteWithCapturedOutput().Should().Fail();
        }
Beispiel #5
0
        public void PublishScriptsRun()
        {
            TestInstance instance = TestAssetsManager.CreateTestInstance("TestAppWithScripts")
                                    .WithLockFiles()
                                    .WithBuildArtifacts();

            var testProject = _getProjectJson(instance.TestRoot, "TestAppWithScripts");

            var publishCommand = new PublishCommand(testProject);
            var result         = publishCommand.ExecuteWithCapturedOutput();

            result.Should().HaveStdOutMatching("\nprepublish_output( \\?[^%]+\\?){5}.+\npostpublish_output( \\?[^%]+\\?){5}", RegexOptions.Singleline);
            result.Should().Pass();
        }
Beispiel #6
0
        public void PublishScriptsRun()
        {
            // create unique directories in the 'temp' folder
            var root = Temp.CreateDirectory();

            var testAppDir = root.CreateDirectory("TestApp");
            var testLibDir = root.CreateDirectory("TestLibrary");

            //copy projects to the temp dir
            CopyProjectToTempDir(Path.Combine(_testProjectsRoot, "TestApp"), testAppDir);
            CopyProjectToTempDir(Path.Combine(_testProjectsRoot, "TestLibrary"), testLibDir);

            // run publish
            var testProject    = GetProjectPath(testAppDir);
            var publishCommand = new PublishCommand(testProject);

            var result = publishCommand.ExecuteWithCapturedOutput();

            result.Should().StdOutMatchPattern("\nprepublish_output( \\?[^%]+\\?){5}.+\npostpublish_output( \\?[^%]+\\?){5}", RegexOptions.Singleline);
            result.Should().Pass();
        }