-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#319) Debug Previewer: add test for configuration creation
- Loading branch information
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/test/kotlin/me/fornever/avaloniarider/test/cases/RunConfigurationUtilsTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package me.fornever.avaloniarider.test.cases | ||
|
||
import com.intellij.execution.configurations.GeneralCommandLine | ||
import com.intellij.openapi.project.ProjectManager | ||
import com.jetbrains.rider.test.asserts.shouldBe | ||
import me.fornever.avaloniarider.rider.createExeConfiguration | ||
import me.fornever.avaloniarider.test.framework.AvaloniaIntegrationTest | ||
import org.testng.annotations.Test | ||
|
||
class RunConfigurationUtilsTests : AvaloniaIntegrationTest() { | ||
|
||
override fun getSolutionDirectoryName() = "MSBuildParameters" | ||
|
||
@Test | ||
fun testCreateExeConfiguration() { | ||
val project = ProjectManager.getInstance().defaultProject | ||
val commandLine = GeneralCommandLine("dotnet", "AvaloniaPreviewer") | ||
.withEnvironment("TEST", "123") | ||
val configuration = createExeConfiguration(project, commandLine) | ||
configuration.project.shouldBe(project) | ||
configuration.parameters.apply { | ||
exePath.shouldBe("dotnet") | ||
programParameters.shouldBe("AvaloniaPreviewer") | ||
envs.shouldBe(mapOf("TEST" to "123")) | ||
isPassParentEnvs.shouldBe(true) | ||
} | ||
} | ||
} |