public SharedTestState()
            {
                RepoDirectories = new RepoDirectoriesProvider();

                TestFrameworkDependentFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                TestFrameworkDependentFixture
                .EnsureRestoredForRid(TestFrameworkDependentFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .PublishProject(runtime: TestFrameworkDependentFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestFrameworkDependentFixture));

                TestSelfContainedFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                TestSelfContainedFixture
                .EnsureRestoredForRid(TestSelfContainedFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .PublishProject(runtime: TestSelfContainedFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestSelfContainedFixture));

                TestAppWithEmptyFileFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                XDocument projectDoc = XDocument.Load(TestAppWithEmptyFileFixture.TestProject.ProjectFile);

                projectDoc.Root.Add(
                    new XElement("ItemGroup",
                                 new XElement("Content",
                                              new XAttribute("Include", "empty.txt"),
                                              new XElement("CopyToOutputDirectory", "PreserveNewest"))));
                projectDoc.Save(TestAppWithEmptyFileFixture.TestProject.ProjectFile);
                File.WriteAllBytes(Path.Combine(TestAppWithEmptyFileFixture.TestProject.Location, "empty.txt"), new byte[0]);
                TestAppWithEmptyFileFixture
                .EnsureRestoredForRid(TestAppWithEmptyFileFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .PublishProject(runtime: TestAppWithEmptyFileFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestAppWithEmptyFileFixture));
            }
Exemplo n.º 2
0
            public SharedTestState()
            {
                RepoDirectories = new RepoDirectoriesProvider();

                var localizedFixture = new TestProjectFixture("LocalizedApp", RepoDirectories);

                localizedFixture
                .EnsureRestoredForRid(localizedFixture.CurrentRid)
                .PublishProject(runtime: localizedFixture.CurrentRid);

                var publishFixture = new TestProjectFixture("StandaloneApp", RepoDirectories);

                publishFixture
                .EnsureRestoredForRid(publishFixture.CurrentRid)
                .PublishProject(runtime: publishFixture.CurrentRid);

                var fwPublishedFixture = new TestProjectFixture("PortableApp", RepoDirectories);

                fwPublishedFixture
                .EnsureRestored()
                .PublishProject();

                StandaloneAppFixture_Localized         = localizedFixture;
                StandaloneAppFixture_Published         = publishFixture;
                FrameworkDependentAppFixture_Published = fwPublishedFixture;
            }
Exemplo n.º 3
0
            public SharedTestState()
            {
                RepoDirectories = new RepoDirectoriesProvider();

                TestFrameworkDependentFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                BundleHelper.AddLongNameContentToAppWithSubDirs(TestFrameworkDependentFixture);
                TestFrameworkDependentFixture
                .EnsureRestoredForRid(TestFrameworkDependentFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .PublishProject(runtime: TestFrameworkDependentFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestFrameworkDependentFixture));

                TestSelfContainedFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                BundleHelper.AddLongNameContentToAppWithSubDirs(TestSelfContainedFixture);
                TestSelfContainedFixture
                .EnsureRestoredForRid(TestSelfContainedFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .PublishProject(runtime: TestSelfContainedFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestSelfContainedFixture));

                TestAppWithEmptyFileFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                BundleHelper.AddLongNameContentToAppWithSubDirs(TestAppWithEmptyFileFixture);
                BundleHelper.AddEmptyContentToApp(TestAppWithEmptyFileFixture);
                TestAppWithEmptyFileFixture
                .EnsureRestoredForRid(TestAppWithEmptyFileFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .PublishProject(runtime: TestAppWithEmptyFileFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestAppWithEmptyFileFixture));
            }
Exemplo n.º 4
0
 public SharedTestState()
 {
     RepoDirectories = new RepoDirectoriesProvider();
     TestFixture     = new TestProjectFixture("SingleFileApiTests", RepoDirectories);
     TestFixture
     .EnsureRestoredForRid(TestFixture.CurrentRid, RepoDirectories.CorehostPackages)
     .PublishProject(runtime: TestFixture.CurrentRid, outputDirectory: BundleHelper.GetPublishPath(TestFixture));
 }
Exemplo n.º 5
0
            public SharedTestState()
            {
                RepoDirectories = new RepoDirectoriesProvider();

                TestFixture = new TestProjectFixture("StandaloneAppWithSubDirs", RepoDirectories);
                TestFixture
                .EnsureRestoredForRid(TestFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .PublishProject(runtime: TestFixture.CurrentRid);
            }
        public void Muxer_activation_of_dotnet_test_XUnit_on_Standalone_Test_App_Succeeds()
        {
            var standaloneTestAppFixture = new TestProjectFixture("StandaloneTestApp", RepoDirectories);

            standaloneTestAppFixture
            .EnsureRestoredForRid(standaloneTestAppFixture.CurrentRid, RepoDirectories.CorehostPackages)
            .BuildProject(runtime: standaloneTestAppFixture.CurrentRid);

            ActivateDotnetTestXunitOnTestProject(RepoDirectories, standaloneTestAppFixture);
        }
Exemplo n.º 7
0
            public SharedTestState()
            {
                RepoDirectories = new RepoDirectoriesProvider();

                TestFixture = new TestProjectFixture("StandaloneApp", RepoDirectories);
                TestFixture
                .EnsureRestoredForRid(TestFixture.CurrentRid)
                .PublishProject(runtime: TestFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestFixture));
            }
Exemplo n.º 8
0
            public TestProjectFixture PreparePublishedSelfContainedTestProject(string projectName)
            {
                var testFixture = new TestProjectFixture(projectName, RepoDirectories);

                testFixture
                .EnsureRestoredForRid(testFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .PublishProject(runtime: testFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(testFixture));

                return(testFixture);
            }
Exemplo n.º 9
0
            public SharedTestState()
            {
                RepoDirectories = new RepoDirectoriesProvider();

                TestFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                BundleHelper.AddLongNameContentToAppWithSubDirs(TestFixture);
                TestFixture
                .EnsureRestoredForRid(TestFixture.CurrentRid)
                .PublishProject(runtime: TestFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestFixture));
            }
Exemplo n.º 10
0
            public TestProjectFixture PreparePublishedSelfContainedTestProject(string projectName, params string[] extraArgs)
            {
                var testFixture = new TestProjectFixture(projectName, RepoDirectories);

                testFixture
                .EnsureRestoredForRid(testFixture.CurrentRid)
                .PublishProject(runtime: testFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(testFixture),
                                extraArgs: extraArgs);

                return(testFixture);
            }
Exemplo n.º 11
0
            public SharedTestState()
            {
                RepoDirectories = new RepoDirectoriesProvider();
                TestFixture     = new TestProjectFixture("HammerServiceApp", RepoDirectories);
                TestFixture
                .EnsureRestoredForRid(TestFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .PublishProject(runtime: TestFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestFixture));

                ServiceFixture = new TestProjectFixture("ServicedLocation", RepoDirectories, assemblyName: "Location");
                ServiceFixture
                .EnsureRestored(RepoDirectories.CorehostPackages)
                .PublishProject(outputDirectory: BundleHelper.GetPublishPath(ServiceFixture));
            }
Exemplo n.º 12
0
            private static TestProjectFixture CreateTestFixture(string testName, string netCoreAppFramework, string mnaVersion)
            {
                var repoDirectories = new RepoDirectoriesProvider(microsoftNETCoreAppVersion: mnaVersion);

                // Use standalone instead of framework-dependent for ease of deployment.
                var publishFixture = new TestProjectFixture(testName, repoDirectories, framework: netCoreAppFramework, assemblyName: "StandaloneApp");

                if (IsRidSupported())
                {
                    publishFixture
                    .EnsureRestoredForRid(publishFixture.CurrentRid)
                    .PublishProject(runtime: publishFixture.CurrentRid);
                }

                return(publishFixture);
            }
Exemplo n.º 13
0
            public SharedTestState()
            {
                RepoDirectories = new RepoDirectoriesProvider();

                // If these versions are changed, also change the corresponding .csproj
                Fixture20 = CreateTestFixture("StandaloneApp20", "netcoreapp2.0", "2.0.7");
                Fixture21 = CreateTestFixture("StandaloneApp21", "netcoreapp2.1", "2.1.0");

                var fixtureLatest = new TestProjectFixture("StandaloneApp", RepoDirectories);

                fixtureLatest
                .EnsureRestoredForRid(fixtureLatest.CurrentRid)
                .PublishProject(runtime: fixtureLatest.CurrentRid);

                FixtureLatest = fixtureLatest;
            }
Exemplo n.º 14
0
            public SharedTestState()
            {
                RepoDirectories = new RepoDirectoriesProvider();

                var buildFixture = new TestProjectFixture("StandaloneApp", RepoDirectories);

                buildFixture
                .EnsureRestoredForRid(buildFixture.CurrentRid)
                .BuildProject(runtime: buildFixture.CurrentRid);

                var publishFixture = new TestProjectFixture("StandaloneApp", RepoDirectories);

                publishFixture
                .EnsureRestoredForRid(publishFixture.CurrentRid)
                .PublishProject(runtime: publishFixture.CurrentRid);

                ReplaceTestProjectOutputHostInTestProjectFixture(buildFixture);

                StandaloneAppFixture_Built     = buildFixture;
                StandaloneAppFixture_Published = publishFixture;
            }
            public SharedTestState()
            {
                RepoDirectories = new RepoDirectoriesProvider();

                var buildFixture = new TestProjectFixture("StandaloneApp", RepoDirectories);

                buildFixture
                .EnsureRestoredForRid(buildFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .BuildProject(runtime: buildFixture.CurrentRid);

                var publishFixture = new TestProjectFixture("StandaloneApp", RepoDirectories);

                publishFixture
                .EnsureRestoredForRid(publishFixture.CurrentRid, RepoDirectories.CorehostPackages)
                .PublishProject(runtime: publishFixture.CurrentRid);

                ReplaceTestProjectOutputHostInTestProjectFixture(buildFixture);

                PreviouslyBuiltAndRestoredStandaloneTestProjectFixture     = buildFixture;
                PreviouslyPublishedAndRestoredStandaloneTestProjectFixture = publishFixture;
            }
Exemplo n.º 16
0
            public SharedTestState()
            {
                TestFrameworkDependentFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                BundleHelper.AddLongNameContentToAppWithSubDirs(TestFrameworkDependentFixture);
                TestFrameworkDependentFixture
                .EnsureRestoredForRid(TestFrameworkDependentFixture.CurrentRid)
                .PublishProject(runtime: TestFrameworkDependentFixture.CurrentRid,
                                selfContained: false,
                                outputDirectory: BundleHelper.GetPublishPath(TestFrameworkDependentFixture));

                TestSelfContainedFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                BundleHelper.AddLongNameContentToAppWithSubDirs(TestSelfContainedFixture);
                TestSelfContainedFixture
                .EnsureRestoredForRid(TestSelfContainedFixture.CurrentRid)
                .PublishProject(runtime: TestSelfContainedFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestSelfContainedFixture));

                TestAppWithEmptyFileFixture = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                BundleHelper.AddLongNameContentToAppWithSubDirs(TestAppWithEmptyFileFixture);
                BundleHelper.AddEmptyContentToApp(TestAppWithEmptyFileFixture);
                TestAppWithEmptyFileFixture
                .EnsureRestoredForRid(TestAppWithEmptyFileFixture.CurrentRid)
                .PublishProject(runtime: TestAppWithEmptyFileFixture.CurrentRid,
                                outputDirectory: BundleHelper.GetPublishPath(TestAppWithEmptyFileFixture));

                TestSelfContainedFixtureComposite = new TestProjectFixture("AppWithSubDirs", RepoDirectories);
                BundleHelper.AddLongNameContentToAppWithSubDirs(TestSelfContainedFixtureComposite);
                TestSelfContainedFixtureComposite
                .EnsureRestoredForRid(TestSelfContainedFixtureComposite.CurrentRid)
                .PublishProject(runtime: TestSelfContainedFixtureComposite.CurrentRid,
                                // ACTIVE ISSUE: https://github.com/dotnet/runtime/issues/54234
                                //               uncomment extraArgs when fixed.
                                outputDirectory: BundleHelper.GetPublishPath(TestSelfContainedFixtureComposite) /*,
                                                                                                                 * extraArgs: new string[] {
                                                                                                                 * "/p:PublishReadyToRun=true",
                                                                                                                 * "/p:PublishReadyToRunComposite=true" } */);
            }