From 5d49e3fd63e2da7891187557e98e409b3c659dda Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Mon, 22 Jan 2024 13:09:43 -0800 Subject: [PATCH] Clean up and consolidate HostModel tests. (#97244) - Merge HostModel AppHost/Bundle/ComHost tests into one `Microsoft.NET.HostModel.Tests` project - Move symbolic link tests into `HostActivation.Tests` - they are not testing HostModel - Rename `AppHostUpdateTests` to `CreateAppHost` - that is the API they are testing - Switch `AppWithUnknownLanguageResource` to pre-built asset - Move to `CreateAppHost` test class --- eng/Subsets.props | 6 +- src/installer/Microsoft.DotNet.CoreSetup.sln | 104 ++++++------------ .../AppHost.Bundle.Tests.csproj | 4 +- .../AppHost.Bundle.Tests/AppLaunch.cs | 0 .../BundleExtractToSpecificPath.cs | 0 .../BundleLocalizedApp.cs | 0 .../AppHost.Bundle.Tests/BundleProbe.cs | 0 .../AppHost.Bundle.Tests/BundleRename.cs | 0 .../BundledAppWithSubDirs.cs | 0 .../AppHost.Bundle.Tests/HammerServiceTest.cs | 2 +- .../SingleFileApiTests.cs | 0 .../AppHost.Bundle.Tests/StaticHost.cs | 0 .../AppWithUnknownLanguageResource.csproj | 2 - .../AppWithUnknownLanguageResource/Program.cs | 0 .../AppWithUnknownLanguageResource/test.rc | 0 .../AppWithUnknownLanguageResource/test.res | Bin .../SymbolicLinks.cs} | 14 +-- .../CreateAppHost.cs} | 61 +++++----- .../BundlerConsistencyTests.cs | 4 +- .../ClsidMapTests.cs | 4 +- .../RegFreeComManifestTests.cs | 27 +++-- .../AppWithUnknownLanguageResource.cs | 47 -------- ...crosoft.NET.HostModel.AppHost.Tests.csproj | 19 ---- ...icrosoft.NET.HostModel.Bundle.Tests.csproj | 19 ---- ...crosoft.NET.HostModel.ComHost.Tests.csproj | 19 ---- .../TestDirectory.cs | 36 ------ .../Microsoft.NET.HostModel.Tests.csproj | 18 +++ .../ResourceUpdaterTests.cs | 0 28 files changed, 107 insertions(+), 279 deletions(-) rename src/installer/tests/{Microsoft.NET.HostModel.Tests => }/AppHost.Bundle.Tests/AppHost.Bundle.Tests.csproj (77%) rename src/installer/tests/{Microsoft.NET.HostModel.Tests => }/AppHost.Bundle.Tests/AppLaunch.cs (100%) rename src/installer/tests/{Microsoft.NET.HostModel.Tests => }/AppHost.Bundle.Tests/BundleExtractToSpecificPath.cs (100%) rename src/installer/tests/{Microsoft.NET.HostModel.Tests => }/AppHost.Bundle.Tests/BundleLocalizedApp.cs (100%) rename src/installer/tests/{Microsoft.NET.HostModel.Tests => }/AppHost.Bundle.Tests/BundleProbe.cs (100%) rename src/installer/tests/{Microsoft.NET.HostModel.Tests => }/AppHost.Bundle.Tests/BundleRename.cs (100%) rename src/installer/tests/{Microsoft.NET.HostModel.Tests => }/AppHost.Bundle.Tests/BundledAppWithSubDirs.cs (100%) rename src/installer/tests/{Microsoft.NET.HostModel.Tests => }/AppHost.Bundle.Tests/HammerServiceTest.cs (98%) rename src/installer/tests/{Microsoft.NET.HostModel.Tests => }/AppHost.Bundle.Tests/SingleFileApiTests.cs (100%) rename src/installer/tests/{Microsoft.NET.HostModel.Tests => }/AppHost.Bundle.Tests/StaticHost.cs (100%) rename src/installer/tests/Assets/{TestProjects => Projects}/AppWithUnknownLanguageResource/AppWithUnknownLanguageResource.csproj (72%) rename src/installer/tests/Assets/{TestProjects => Projects}/AppWithUnknownLanguageResource/Program.cs (100%) rename src/installer/tests/Assets/{TestProjects => Projects}/AppWithUnknownLanguageResource/test.rc (100%) rename src/installer/tests/Assets/{TestProjects => Projects}/AppWithUnknownLanguageResource/test.res (100%) rename src/installer/tests/{Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUsedWithSymbolicLinks.cs => HostActivation.Tests/SymbolicLinks.cs} (97%) rename src/installer/tests/Microsoft.NET.HostModel.Tests/{Microsoft.NET.HostModel.AppHost.Tests/AppHostUpdateTests.cs => AppHost/CreateAppHost.cs} (92%) rename src/installer/tests/Microsoft.NET.HostModel.Tests/{Microsoft.NET.HostModel.Bundle.Tests => Bundle}/BundlerConsistencyTests.cs (99%) rename src/installer/tests/Microsoft.NET.HostModel.Tests/{Microsoft.NET.HostModel.ComHost.Tests => ComHost}/ClsidMapTests.cs (97%) rename src/installer/tests/Microsoft.NET.HostModel.Tests/{Microsoft.NET.HostModel.ComHost.Tests => ComHost}/RegFreeComManifestTests.cs (84%) delete mode 100644 src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppWithUnknownLanguageResource.cs delete mode 100644 src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/Microsoft.NET.HostModel.AppHost.Tests.csproj delete mode 100644 src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/Microsoft.NET.HostModel.Bundle.Tests.csproj delete mode 100644 src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/Microsoft.NET.HostModel.ComHost.Tests.csproj delete mode 100644 src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/TestDirectory.cs create mode 100644 src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Tests.csproj rename src/installer/tests/Microsoft.NET.HostModel.Tests/{Microsoft.NET.HostModel.AppHost.Tests => }/ResourceUpdaterTests.cs (100%) diff --git a/eng/Subsets.props b/eng/Subsets.props index b769e1c18a0d6..2ed013d619c20 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -495,11 +495,9 @@ - - - - + + diff --git a/src/installer/Microsoft.DotNet.CoreSetup.sln b/src/installer/Microsoft.DotNet.CoreSetup.sln index 7eb575cd0b7b3..e75c1e933954e 100644 --- a/src/installer/Microsoft.DotNet.CoreSetup.sln +++ b/src/installer/Microsoft.DotNet.CoreSetup.sln @@ -15,15 +15,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtils", "tests\TestUtil EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.HostModel", "managed\Microsoft.NET.HostModel\Microsoft.NET.HostModel.csproj", "{325FB7F2-2E2E-422D-ADAA-F0B63E84CF24}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppHost.Bundle.Tests", "tests\Microsoft.NET.HostModel.Tests\AppHost.Bundle.Tests\AppHost.Bundle.Tests.csproj", "{2745A51D-3425-4F68-8349-A8B8BC27DD87}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.HostModel.Bundle.Tests", "tests\Microsoft.NET.HostModel.Tests\Microsoft.NET.HostModel.Bundle.Tests\Microsoft.NET.HostModel.Bundle.Tests.csproj", "{1E76A78E-9E39-480D-8CD3-B7D0A858FECB}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.CoreSetup.Packaging.Tests", "tests\Microsoft.DotNet.CoreSetup.Packaging.Tests\Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj", "{F1584324-A41A-4CE7-B23F-DB2252CFE276}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.HostModel.AppHost.Tests", "tests\Microsoft.NET.HostModel.Tests\Microsoft.NET.HostModel.AppHost.Tests\Microsoft.NET.HostModel.AppHost.Tests.csproj", "{AA3430BA-AE4A-4D52-B29D-B072A646C230}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppHost.Bundle.Tests", "tests\AppHost.Bundle.Tests\AppHost.Bundle.Tests.csproj", "{0496C031-637B-4862-B7ED-B4505E68F241}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.HostModel.ComHost.Tests", "tests\Microsoft.NET.HostModel.Tests\Microsoft.NET.HostModel.ComHost.Tests\Microsoft.NET.HostModel.ComHost.Tests.csproj", "{35EF7826-6D47-4C91-AFDF-91091C05FB13}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.HostModel.Tests", "tests\Microsoft.NET.HostModel.Tests\Microsoft.NET.HostModel.Tests.csproj", "{9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -85,38 +81,6 @@ Global {325FB7F2-2E2E-422D-ADAA-F0B63E84CF24}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU {325FB7F2-2E2E-422D-ADAA-F0B63E84CF24}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU {325FB7F2-2E2E-422D-ADAA-F0B63E84CF24}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.Debug|x64.ActiveCfg = Debug|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.Debug|x64.Build.0 = Debug|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.MinSizeRel|x64.Build.0 = Debug|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.Release|Any CPU.Build.0 = Release|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.Release|x64.ActiveCfg = Release|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.Release|x64.Build.0 = Release|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {2745A51D-3425-4F68-8349-A8B8BC27DD87}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.Debug|x64.ActiveCfg = Debug|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.Debug|x64.Build.0 = Debug|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.MinSizeRel|x64.Build.0 = Debug|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.Release|Any CPU.Build.0 = Release|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.Release|x64.ActiveCfg = Release|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.Release|x64.Build.0 = Release|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {1E76A78E-9E39-480D-8CD3-B7D0A858FECB}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {F1584324-A41A-4CE7-B23F-DB2252CFE276}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F1584324-A41A-4CE7-B23F-DB2252CFE276}.Debug|Any CPU.Build.0 = Debug|Any CPU {F1584324-A41A-4CE7-B23F-DB2252CFE276}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -133,38 +97,38 @@ Global {F1584324-A41A-4CE7-B23F-DB2252CFE276}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU {F1584324-A41A-4CE7-B23F-DB2252CFE276}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU {F1584324-A41A-4CE7-B23F-DB2252CFE276}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.Debug|x64.ActiveCfg = Debug|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.Debug|x64.Build.0 = Debug|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.MinSizeRel|x64.Build.0 = Debug|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.Release|Any CPU.Build.0 = Release|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.Release|x64.ActiveCfg = Release|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.Release|x64.Build.0 = Release|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {AA3430BA-AE4A-4D52-B29D-B072A646C230}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.Debug|Any CPU.Build.0 = Debug|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.Debug|x64.ActiveCfg = Debug|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.Debug|x64.Build.0 = Debug|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.MinSizeRel|x64.Build.0 = Debug|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.Release|Any CPU.ActiveCfg = Release|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.Release|Any CPU.Build.0 = Release|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.Release|x64.ActiveCfg = Release|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.Release|x64.Build.0 = Release|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {35EF7826-6D47-4C91-AFDF-91091C05FB13}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.Debug|x64.ActiveCfg = Debug|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.Debug|x64.Build.0 = Debug|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.Release|Any CPU.Build.0 = Release|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.Release|x64.ActiveCfg = Release|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.Release|x64.Build.0 = Release|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {0496C031-637B-4862-B7ED-B4505E68F241}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.Debug|x64.ActiveCfg = Debug|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.Debug|x64.Build.0 = Debug|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.Release|Any CPU.Build.0 = Release|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.Release|x64.ActiveCfg = Release|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.Release|x64.Build.0 = Release|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {9212E3B2-DFCB-4A24-99AA-ED5F9ACAA87F}.RelWithDebInfo|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/AppHost.Bundle.Tests.csproj b/src/installer/tests/AppHost.Bundle.Tests/AppHost.Bundle.Tests.csproj similarity index 77% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/AppHost.Bundle.Tests.csproj rename to src/installer/tests/AppHost.Bundle.Tests/AppHost.Bundle.Tests.csproj index af4c08cf0869e..e70ca66a4f0be 100644 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/AppHost.Bundle.Tests.csproj +++ b/src/installer/tests/AppHost.Bundle.Tests/AppHost.Bundle.Tests.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/AppLaunch.cs b/src/installer/tests/AppHost.Bundle.Tests/AppLaunch.cs similarity index 100% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/AppLaunch.cs rename to src/installer/tests/AppHost.Bundle.Tests/AppLaunch.cs diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleExtractToSpecificPath.cs b/src/installer/tests/AppHost.Bundle.Tests/BundleExtractToSpecificPath.cs similarity index 100% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleExtractToSpecificPath.cs rename to src/installer/tests/AppHost.Bundle.Tests/BundleExtractToSpecificPath.cs diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleLocalizedApp.cs b/src/installer/tests/AppHost.Bundle.Tests/BundleLocalizedApp.cs similarity index 100% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleLocalizedApp.cs rename to src/installer/tests/AppHost.Bundle.Tests/BundleLocalizedApp.cs diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleProbe.cs b/src/installer/tests/AppHost.Bundle.Tests/BundleProbe.cs similarity index 100% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleProbe.cs rename to src/installer/tests/AppHost.Bundle.Tests/BundleProbe.cs diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleRename.cs b/src/installer/tests/AppHost.Bundle.Tests/BundleRename.cs similarity index 100% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundleRename.cs rename to src/installer/tests/AppHost.Bundle.Tests/BundleRename.cs diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundledAppWithSubDirs.cs b/src/installer/tests/AppHost.Bundle.Tests/BundledAppWithSubDirs.cs similarity index 100% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/BundledAppWithSubDirs.cs rename to src/installer/tests/AppHost.Bundle.Tests/BundledAppWithSubDirs.cs diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/HammerServiceTest.cs b/src/installer/tests/AppHost.Bundle.Tests/HammerServiceTest.cs similarity index 98% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/HammerServiceTest.cs rename to src/installer/tests/AppHost.Bundle.Tests/HammerServiceTest.cs index 1b521e186a258..0c7911a18f38d 100644 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/HammerServiceTest.cs +++ b/src/installer/tests/AppHost.Bundle.Tests/HammerServiceTest.cs @@ -27,7 +27,7 @@ private void SingleFile_Apps_Are_Serviced() { var singleFile = sharedTestState.App.Bundle(); - // Create the servicing directory, and copy the servived DLL from service fixture to the servicing directory. + // Create the servicing directory, and copy the serviced DLL from service fixture to the servicing directory. var serviced = sharedTestState.ServicedLibrary; var serviceBasePath = Path.Combine(sharedTestState.App.Location, "coreservicing"); var servicePath = Path.Combine(serviceBasePath, "pkgs", serviced.Name, "1.0.0"); diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/SingleFileApiTests.cs b/src/installer/tests/AppHost.Bundle.Tests/SingleFileApiTests.cs similarity index 100% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/SingleFileApiTests.cs rename to src/installer/tests/AppHost.Bundle.Tests/SingleFileApiTests.cs diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/StaticHost.cs b/src/installer/tests/AppHost.Bundle.Tests/StaticHost.cs similarity index 100% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost.Bundle.Tests/StaticHost.cs rename to src/installer/tests/AppHost.Bundle.Tests/StaticHost.cs diff --git a/src/installer/tests/Assets/TestProjects/AppWithUnknownLanguageResource/AppWithUnknownLanguageResource.csproj b/src/installer/tests/Assets/Projects/AppWithUnknownLanguageResource/AppWithUnknownLanguageResource.csproj similarity index 72% rename from src/installer/tests/Assets/TestProjects/AppWithUnknownLanguageResource/AppWithUnknownLanguageResource.csproj rename to src/installer/tests/Assets/Projects/AppWithUnknownLanguageResource/AppWithUnknownLanguageResource.csproj index a1927cdcc709f..4b68943005e42 100644 --- a/src/installer/tests/Assets/TestProjects/AppWithUnknownLanguageResource/AppWithUnknownLanguageResource.csproj +++ b/src/installer/tests/Assets/Projects/AppWithUnknownLanguageResource/AppWithUnknownLanguageResource.csproj @@ -3,8 +3,6 @@ $(NetCoreAppCurrent) Exe - $(TestTargetRid) - $(MNAVersion) test.res false diff --git a/src/installer/tests/Assets/TestProjects/AppWithUnknownLanguageResource/Program.cs b/src/installer/tests/Assets/Projects/AppWithUnknownLanguageResource/Program.cs similarity index 100% rename from src/installer/tests/Assets/TestProjects/AppWithUnknownLanguageResource/Program.cs rename to src/installer/tests/Assets/Projects/AppWithUnknownLanguageResource/Program.cs diff --git a/src/installer/tests/Assets/TestProjects/AppWithUnknownLanguageResource/test.rc b/src/installer/tests/Assets/Projects/AppWithUnknownLanguageResource/test.rc similarity index 100% rename from src/installer/tests/Assets/TestProjects/AppWithUnknownLanguageResource/test.rc rename to src/installer/tests/Assets/Projects/AppWithUnknownLanguageResource/test.rc diff --git a/src/installer/tests/Assets/TestProjects/AppWithUnknownLanguageResource/test.res b/src/installer/tests/Assets/Projects/AppWithUnknownLanguageResource/test.res similarity index 100% rename from src/installer/tests/Assets/TestProjects/AppWithUnknownLanguageResource/test.res rename to src/installer/tests/Assets/Projects/AppWithUnknownLanguageResource/test.res diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUsedWithSymbolicLinks.cs b/src/installer/tests/HostActivation.Tests/SymbolicLinks.cs similarity index 97% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUsedWithSymbolicLinks.cs rename to src/installer/tests/HostActivation.Tests/SymbolicLinks.cs index a8b6b3c89cda1..45ad4f9961af0 100644 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUsedWithSymbolicLinks.cs +++ b/src/installer/tests/HostActivation.Tests/SymbolicLinks.cs @@ -1,22 +1,22 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using FluentAssertions; -using Microsoft.DotNet.Cli.Build.Framework; -using Microsoft.DotNet.CoreSetup.Test; using System; using System.IO; using System.Linq; -using System.Runtime.InteropServices; + +using FluentAssertions; +using Microsoft.DotNet.Cli.Build.Framework; +using Microsoft.DotNet.CoreSetup.Test; using Xunit; -namespace Microsoft.NET.HostModel.Tests +namespace HostActivation.Tests { - public class AppHostUsedWithSymbolicLinks : IClassFixture + public class SymbolicLinks : IClassFixture { private SharedTestState sharedTestState; - public AppHostUsedWithSymbolicLinks(AppHostUsedWithSymbolicLinks.SharedTestState fixture) + public SymbolicLinks(SymbolicLinks.SharedTestState fixture) { sharedTestState = fixture; } diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUpdateTests.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost/CreateAppHost.cs similarity index 92% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUpdateTests.cs rename to src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost/CreateAppHost.cs index b4d038b99b5ce..b125a8553cd41 100644 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppHostUpdateTests.cs +++ b/src/installer/tests/Microsoft.NET.HostModel.Tests/AppHost/CreateAppHost.cs @@ -2,20 +2,20 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics; using System.IO; using System.Linq; +using System.Reflection.PortableExecutable; using System.Runtime.CompilerServices; using System.Text; + using FluentAssertions; -using Xunit; -using Microsoft.NET.HostModel.AppHost; using Microsoft.DotNet.CoreSetup.Test; -using System.Diagnostics; -using System.Reflection.PortableExecutable; +using Xunit; -namespace Microsoft.NET.HostModel.Tests +namespace Microsoft.NET.HostModel.AppHost.Tests { - public class AppHostUpdateTests + public class CreateAppHost { /// /// hash value embedded in default apphost executable in a place where the path to the app binary should be stored. @@ -24,7 +24,7 @@ public class AppHostUpdateTests private readonly static byte[] AppBinaryPathPlaceholderSearchValue = Encoding.UTF8.GetBytes(AppBinaryPathPlaceholder); [Fact] - public void ItEmbedsAppBinaryPath() + public void EmbedAppBinaryPath() { using (TestDirectory testDirectory = TestDirectory.Create()) { @@ -48,12 +48,12 @@ public void ItEmbedsAppBinaryPath() BitConverter .ToUInt16(result, SubsystemOffset) .Should() - .Be(3); + .Be((ushort)Subsystem.WindowsCui); } } [Fact] - public void ItFailsToEmbedAppBinaryIfHashIsWrong() + public void PlaceholderHashNotFound_Fails() { using (TestDirectory testDirectory = TestDirectory.Create()) { @@ -76,7 +76,7 @@ public void ItFailsToEmbedAppBinaryIfHashIsWrong() } [Fact] - public void ItFailsToEmbedTooLongAppBinaryPath() + public void AppBinaryPathTooLong_Fails() { using (TestDirectory testDirectory = TestDirectory.Create()) { @@ -95,7 +95,7 @@ public void ItFailsToEmbedTooLongAppBinaryPath() } [Fact] - public void ItCanSetWindowsGUISubsystem() + public void GUISubsystem_WindowsPEFile() { using (TestDirectory testDirectory = TestDirectory.Create()) { @@ -119,7 +119,7 @@ public void ItCanSetWindowsGUISubsystem() } [Fact] - public void ItFailsToSetGUISubsystemOnNonWindowsPEFile() + public void GUISubsystem_NonWindowsPEFile_Fails() { using (TestDirectory testDirectory = TestDirectory.Create()) { @@ -144,7 +144,7 @@ public void ItFailsToSetGUISubsystemOnNonWindowsPEFile() } [Fact] - public void ItFailsToSetGUISubsystemWithWrongDefault() + public void GUISubsystem_WrongDefault_Fails() { using (TestDirectory testDirectory = TestDirectory.Create()) { @@ -170,7 +170,7 @@ public void ItFailsToSetGUISubsystemWithWrongDefault() [Fact] [PlatformSpecific(TestPlatforms.AnyUnix)] - public void ItGeneratesExecutableImage() + public void ExecutableImage() { using TestDirectory testDirectory = TestDirectory.Create(); string sourceAppHostMock = PrepareAppHostMockFile(testDirectory); @@ -198,30 +198,11 @@ public void ItGeneratesExecutableImage() .Be(expectedPermissions); } - [Fact] - public void CanCreateAppHost() - { - using (TestDirectory testDirectory = TestDirectory.Create()) - { - string sourceAppHostMock = PrepareAppHostMockFile(testDirectory); - File.SetAttributes(sourceAppHostMock, FileAttributes.ReadOnly); - string destinationFilePath = Path.Combine(testDirectory.Path, "DestinationAppHost.exe.mock"); - string appBinaryFilePath = "Test/App/Binary/Path.dll"; - HostWriter.CreateAppHost( - sourceAppHostMock, - destinationFilePath, - appBinaryFilePath, - windowsGraphicalUserInterface: false); - - File.SetAttributes(sourceAppHostMock, FileAttributes.Normal); - } - } - [Theory] [PlatformSpecific(TestPlatforms.OSX)] [InlineData("")] [InlineData("dir with spaces")] - public void CanCodeSignAppHostOnMacOS(string subdir) + public void CodeSignAppHostOnMacOS(string subdir) { using (TestDirectory testDirectory = TestDirectory.Create(subdir)) { @@ -258,7 +239,7 @@ public void CanCodeSignAppHostOnMacOS(string subdir) [Fact] [PlatformSpecific(TestPlatforms.OSX)] - public void ItDoesNotCodeSignAppHostByDefault() + public void DoesNotCodeSignAppHostByDefault() { using (TestDirectory testDirectory = TestDirectory.Create()) { @@ -321,6 +302,16 @@ public void CodeSigningFailuresThrow() } } + [Fact] + private void ResourceWithUnknownLanguage() + { + // https://github.com/dotnet/runtime/issues/88465 + using (TestApp app = TestApp.CreateFromBuiltAssets("AppWithUnknownLanguageResource")) + { + app.CreateAppHost(); + } + } + private string PrepareAppHostMockFile(TestDirectory testDirectory, Action customize = null) { // For now we're testing the AppHost on Windows PE files only. diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/BundlerConsistencyTests.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/Bundle/BundlerConsistencyTests.cs similarity index 99% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/BundlerConsistencyTests.cs rename to src/installer/tests/Microsoft.NET.HostModel.Tests/Bundle/BundlerConsistencyTests.cs index def7820bc74a4..a48b5ae13e493 100644 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/BundlerConsistencyTests.cs +++ b/src/installer/tests/Microsoft.NET.HostModel.Tests/Bundle/BundlerConsistencyTests.cs @@ -6,13 +6,13 @@ using System.IO; using System.Linq; using System.Runtime.InteropServices; + using FluentAssertions; using Microsoft.DotNet.Cli.Build.Framework; using Microsoft.DotNet.CoreSetup.Test; -using Microsoft.NET.HostModel.Bundle; using Xunit; -namespace Microsoft.NET.HostModel.Tests +namespace Microsoft.NET.HostModel.Bundle.Tests { public class BundlerConsistencyTests : IClassFixture { diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/ClsidMapTests.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/ComHost/ClsidMapTests.cs similarity index 97% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/ClsidMapTests.cs rename to src/installer/tests/Microsoft.NET.HostModel.Tests/ComHost/ClsidMapTests.cs index 4cfa179ee605c..af0c0308b7c65 100644 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/ClsidMapTests.cs +++ b/src/installer/tests/Microsoft.NET.HostModel.Tests/ComHost/ClsidMapTests.cs @@ -107,8 +107,8 @@ public void ExplicitlyEmptyProgIdNotInClsidMap() private JObject CreateClsidMap(TestApp library) { - using var testDirectory = TestDirectory.Create(); - string clsidMapPath = Path.Combine(testDirectory.Path, "test.clsidmap"); + using var testDirectory = TestArtifact.Create("clsidmap"); + string clsidMapPath = Path.Combine(testDirectory.Location, "test.clsidmap"); using (var assemblyStream = new FileStream(library.AppDll, FileMode.Open, FileAccess.Read, FileShare.Delete | FileShare.Read)) using (PEReader peReader = new PEReader(assemblyStream)) diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/RegFreeComManifestTests.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/ComHost/RegFreeComManifestTests.cs similarity index 84% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/RegFreeComManifestTests.cs rename to src/installer/tests/Microsoft.NET.HostModel.Tests/ComHost/RegFreeComManifestTests.cs index 9a4f47e79b72d..042553509a460 100644 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/RegFreeComManifestTests.cs +++ b/src/installer/tests/Microsoft.NET.HostModel.Tests/ComHost/RegFreeComManifestTests.cs @@ -1,14 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; using System.Xml.Linq; + +using Microsoft.DotNet.CoreSetup.Test; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using Xunit; namespace Microsoft.NET.HostModel.ComHost.Tests @@ -20,19 +19,19 @@ public class RegFreeComManifestTests [Fact] public void RegFreeComManifestCorrectlyIncludesComHostFile() { - using TestDirectory directory = TestDirectory.Create(); + using TestArtifact directory = TestArtifact.Create(nameof(RegFreeComManifestCorrectlyIncludesComHostFile)); JObject clsidMap = new JObject { }; - string clsidmapPath = Path.Combine(directory.Path, "test.clsidmap"); + string clsidmapPath = Path.Combine(directory.Location, "test.clsidmap"); string json = JsonConvert.SerializeObject(clsidMap); string comHostName = "comhost.dll"; File.WriteAllText(clsidmapPath, json); - string regFreeComManifestPath = Path.Combine(directory.Path, "test.manifest"); + string regFreeComManifestPath = Path.Combine(directory.Location, "test.manifest"); RegFreeComManifest.CreateManifestFromClsidmap("assemblyName", comHostName, "1.0.0.0", clsidmapPath, regFreeComManifestPath); @@ -49,7 +48,7 @@ public void RegFreeComManifestCorrectlyIncludesComHostFile() [Fact] public void EntryInClsidMapAddedToRegFreeComManifest() { - using TestDirectory directory = TestDirectory.Create(); + using TestArtifact directory = TestArtifact.Create(nameof(EntryInClsidMapAddedToRegFreeComManifest)); string guid = "{190f1974-fa98-4922-8ed4-cf748630abbe}"; string assemblyName = "ComLibrary"; string typeName = "ComLibrary.Server"; @@ -62,13 +61,13 @@ public void EntryInClsidMapAddedToRegFreeComManifest() } }; - string clsidmapPath = Path.Combine(directory.Path, "test.clsidmap"); + string clsidmapPath = Path.Combine(directory.Location, "test.clsidmap"); string json = JsonConvert.SerializeObject(clsidMap); string comHostName = "comhost.dll"; File.WriteAllText(clsidmapPath, json); - string regFreeComManifestPath = Path.Combine(directory.Path, "test.manifest"); + string regFreeComManifestPath = Path.Combine(directory.Location, "test.manifest"); RegFreeComManifest.CreateManifestFromClsidmap(assemblyName, comHostName, assemblyVersion, clsidmapPath, regFreeComManifestPath); @@ -84,7 +83,7 @@ public void EntryInClsidMapAddedToRegFreeComManifest() [Fact] public void EntryInClsidMapAddedToRegFreeComManifestIncludesProgId() { - using TestDirectory directory = TestDirectory.Create(); + using TestArtifact directory = TestArtifact.Create(nameof(EntryInClsidMapAddedToRegFreeComManifestIncludesProgId)); string guid = "{190f1974-fa98-4922-8ed4-cf748630abbe}"; string assemblyName = "ComLibrary"; string typeName = "ComLibrary.Server"; @@ -98,13 +97,13 @@ public void EntryInClsidMapAddedToRegFreeComManifestIncludesProgId() } }; - string clsidmapPath = Path.Combine(directory.Path, "test.clsidmap"); + string clsidmapPath = Path.Combine(directory.Location, "test.clsidmap"); string json = JsonConvert.SerializeObject(clsidMap); string comHostName = "comhost.dll"; File.WriteAllText(clsidmapPath, json); - string regFreeComManifestPath = Path.Combine(directory.Path, "test.manifest"); + string regFreeComManifestPath = Path.Combine(directory.Location, "test.manifest"); RegFreeComManifest.CreateManifestFromClsidmap(assemblyName, comHostName, assemblyVersion, clsidmapPath, regFreeComManifestPath); diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppWithUnknownLanguageResource.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppWithUnknownLanguageResource.cs deleted file mode 100644 index 8e57c2ada74e2..0000000000000 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/AppWithUnknownLanguageResource.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using Microsoft.DotNet.CoreSetup.Test; -using Xunit; - -namespace Microsoft.NET.HostModel.Tests -{ - // https://github.com/dotnet/runtime/issues/88465 - public class AppWithUnknownLanguageResource : IClassFixture - { - private SharedTestState sharedTestState; - - public AppWithUnknownLanguageResource(SharedTestState fixture) - { - sharedTestState = fixture; - } - - [Fact] - private void Can_Build_App_With_Resource_With_Unknown_Language() - { - var fixture = sharedTestState.TestFixture.Copy(); - - fixture.TestProject.BuiltApp.CreateAppHost(); - } - - public class SharedTestState : IDisposable - { - public RepoDirectoriesProvider RepoDirectories { get; set; } - public TestProjectFixture TestFixture { get; set; } - - public SharedTestState() - { - RepoDirectories = new RepoDirectoriesProvider(); - var testFixture = new TestProjectFixture("AppWithUnknownLanguageResource", RepoDirectories); - testFixture.EnsureRestored().BuildProject(); - TestFixture = testFixture; - } - - public void Dispose() - { - TestFixture.Dispose(); - } - } - } -} diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/Microsoft.NET.HostModel.AppHost.Tests.csproj b/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/Microsoft.NET.HostModel.AppHost.Tests.csproj deleted file mode 100644 index 012d7ce6261d2..0000000000000 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/Microsoft.NET.HostModel.AppHost.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - Microsoft.NET.HostModel.AppHost Tests - $(TestInfraTargetFramework) - Microsoft.NET.HostModel.AppHost.Tests - Microsoft.NET.HostModel.AppHost.Tests - true - - hma - true - - - - - - - - diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/Microsoft.NET.HostModel.Bundle.Tests.csproj b/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/Microsoft.NET.HostModel.Bundle.Tests.csproj deleted file mode 100644 index ad94f762b3044..0000000000000 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/Microsoft.NET.HostModel.Bundle.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - Microsoft.NET.HostModel.Bundle Tests - $(TestInfraTargetFramework) - Microsoft.NET.HostModel.Bundle.Tests - Microsoft.NET.HostModel.Bundle.Tests - true - - hmb - true - - - - - - - - diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/Microsoft.NET.HostModel.ComHost.Tests.csproj b/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/Microsoft.NET.HostModel.ComHost.Tests.csproj deleted file mode 100644 index 4f8d6cb298aff..0000000000000 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/Microsoft.NET.HostModel.ComHost.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - Microsoft.NET.HostModel.ComHost Tests - $(TestInfraTargetFramework) - Microsoft.NET.HostModel.ComHost.Tests - Microsoft.NET.HostModel.ComHost.Tests - true - - hmc - true - - - - - - - - diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/TestDirectory.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/TestDirectory.cs deleted file mode 100644 index e4dac9750cc20..0000000000000 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.ComHost.Tests/TestDirectory.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.IO; -using System.Runtime.CompilerServices; - -namespace Microsoft.NET.HostModel.ComHost.Tests -{ - internal class TestDirectory : IDisposable - { - public string Path { get; private set; } - - private TestDirectory(string path) - { - Path = path; - Directory.CreateDirectory(path); - } - - public static TestDirectory Create([CallerMemberName] string callingMethod = "") - { - string path = System.IO.Path.Combine( - System.IO.Path.GetTempPath(), - "dotNetSdkUnitTest_" + callingMethod + (Guid.NewGuid().ToString().Substring(0, 8))); - return new TestDirectory(path); - } - - public void Dispose() - { - if (Directory.Exists(Path)) - { - Directory.Delete(Path, true); - } - } - } -} diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Tests.csproj b/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Tests.csproj new file mode 100644 index 0000000000000..e809026a29c46 --- /dev/null +++ b/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Tests.csproj @@ -0,0 +1,18 @@ + + + + Microsoft.NET.HostModel.Tests + $(TestInfraTargetFramework) + Microsoft.NET.HostModel.Tests + true + + hm + true + + + + + + + + diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/ResourceUpdaterTests.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/ResourceUpdaterTests.cs similarity index 100% rename from src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.AppHost.Tests/ResourceUpdaterTests.cs rename to src/installer/tests/Microsoft.NET.HostModel.Tests/ResourceUpdaterTests.cs