-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(dsl): Refacto exception constructor (#44)
- Loading branch information
Showing
3 changed files
with
40 additions
and
5 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
30 changes: 30 additions & 0 deletions
30
...hutneytesting/kotlin/junit/engine/execution/UnresolvedScenarioEnvironmentExceptionTest.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,30 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2017-2024 Enedis | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package com.chutneytesting.kotlin.junit.engine.execution | ||
|
||
import org.junit.jupiter.api.Assertions.assertEquals | ||
import org.junit.jupiter.api.Test | ||
|
||
class UnresolvedScenarioEnvironmentExceptionTest { | ||
|
||
@Test | ||
fun exceptionMessageWithEnvironmentName() { | ||
val throwable = Throwable("Error occurred") | ||
val exception = UnresolvedScenarioEnvironmentException(throwable, "test-environment") | ||
|
||
assertEquals("Error occurred: Environment [test-environment] not found.", exception.message) | ||
} | ||
|
||
@Test | ||
fun exceptionMessageWithoutEnvironmentName() { | ||
val throwable = Throwable("Error occurred") | ||
val exception = UnresolvedScenarioEnvironmentException(throwable) | ||
|
||
assertEquals("Error occurred: Please, specify a name or declare only one environment.", exception.message) | ||
} | ||
} |