Files
runner-images/images/win/scripts/Tests/VisualStudio.Tests.ps1
Leonid Lapshin 54978f0e06 Add VS build tools installation for Windows (#1533)
* add VS build tools installation, tests, reports, made minor changes to current VS install helper functions

* Vstype typo

* removed unused variable

* validate set for new functions

* some variable names clarifications

* test parameter error

* style and syntax improvments

* syntax notation

Co-authored-by: Leonid Lapshin <originalnoe-nazvanie@yandex.ru>
2020-09-08 10:48:31 +03:00

35 lines
1.3 KiB
PowerShell

Describe "Visual Studio" {
Context "Basic" {
It "Catalog.json" {
Get-VsCatalogJsonPath | Should -Exist
}
It "Devenv.exe" {
$vsInstallRoot = (Get-VisualStudioProduct -ProductType "VisualStudio").InstallationPath
$devenvexePath = "${vsInstallRoot}\Common7\IDE\devenv.exe"
$devenvexePath | Should -Exist
}
}
Context "Visual Studio components" {
$testCases = (Get-ToolsetContent).visualStudio.workloads | ForEach-Object { @{ComponentName = $_} }
BeforeAll {
$installedComponents = Get-VisualStudioComponents -ProductType "VisualStudio" | Select-Object -ExpandProperty Package
}
It "<ComponentName>" -TestCases $testCases {
$installedComponents | Should -Contain $ComponentName
}
}
Context "Visual Studio Build Tools components" {
$testCases = (Get-ToolsetContent).visualStudio.buildtools_workloads | ForEach-Object { @{ComponentName = $_} }
BeforeAll {
$installedComponents = Get-VisualStudioComponents -ProductType "BuildTools" | Select-Object -ExpandProperty Package
}
It "<ComponentName>" -TestCases $testCases {
$installedComponents | Should -Contain $ComponentName
}
}
}