Skip to content

Commit

Permalink
better NotImplementedError handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Daoortor committed Jul 17, 2024
1 parent 7d60b22 commit d62de23
Show file tree
Hide file tree
Showing 55 changed files with 308 additions and 18 deletions.
8 changes: 8 additions & 0 deletions AlmostDone/CompleteTheProject/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
private const val SQUARED = "squared"
Expand Down Expand Up @@ -115,6 +118,11 @@ class Test {
}
}

@Test
fun smokeTest() {
runMainFunction(::main, "$YES$newLineSymbol$SIMBA$newLineSymbol$BORDERS$newLineSymbol")
}

@Test
fun testPhotoshopFunction() {
mainClass.checkMethod(mainClazz, photoshop)
Expand Down
3 changes: 3 additions & 0 deletions AlmostDone/MultiRowStrings/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {

Expand Down
3 changes: 3 additions & 0 deletions AlmostDone/NullSafety/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
private const val SQUARED = "squared"
Expand Down
3 changes: 3 additions & 0 deletions AlmostDone/NullSafetyPartTwo/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
private const val SQUARED = "squared"
Expand Down
3 changes: 3 additions & 0 deletions AlmostDone/StringFunctions/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError(["applySquaredFilter"])
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions AlmostDone/StringFunctionsPartTwo/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions AlmostDone/When/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError(["applyBordersFilter", "applySquaredFilter"])
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
private const val WITH_INDENT =
Expand Down
3 changes: 3 additions & 0 deletions AlmostDone/applyBordersFilterFunction/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {

Expand Down
3 changes: 3 additions & 0 deletions AlmostDone/choosePictureFunction/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
private const val SQUARED = "squared"
Expand Down
3 changes: 3 additions & 0 deletions AlmostDone/safeReadLineFunction/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*
import util.Util.newLineSeparator

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
5 changes: 5 additions & 0 deletions Chat/askFirstQuestion/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import org.junit.jupiter.api.Test
import util.Util
import util.Util.DEFAULT_USER_INPUT
import util.runMainFunction
import org.junit.jupiter.api.extension.ExtendWith
import util.HandleNotImplementedError
import util.HandleNotImplementedErrorExtension

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
@Test
fun testSolution() {
Expand Down
5 changes: 5 additions & 0 deletions Chat/askSecondQuestion/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import org.junit.jupiter.api.Test
import util.Util
import util.Util.DEFAULT_USER_INPUT
import util.runMainFunction
import org.junit.jupiter.api.extension.ExtendWith
import util.HandleNotImplementedError
import util.HandleNotImplementedErrorExtension

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
@Test
fun testSolution() {
Expand Down
5 changes: 5 additions & 0 deletions Chat/completeTheProject/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import org.junit.jupiter.api.Test
import util.Util
import util.Util.DEFAULT_USER_INPUT
import util.runMainFunction
import org.junit.jupiter.api.extension.ExtendWith
import util.HandleNotImplementedError
import util.HandleNotImplementedErrorExtension

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
@Test
fun testSolution() {
Expand Down
13 changes: 9 additions & 4 deletions Hangman/CompleteTheProject/test/Tests.kt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import jetbrains.kotlin.course.hangman.generateNewUserWord
import jetbrains.kotlin.course.hangman.separator
import jetbrains.kotlin.course.hangman.underscore
import jetbrains.kotlin.course.hangman.words
import jetbrains.kotlin.course.hangman.*
import org.jetbrains.academy.test.system.core.invokeWithArgs
import org.jetbrains.academy.test.system.core.invokeWithoutArgs
import org.jetbrains.academy.test.system.core.models.classes.TestClass
import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.jetbrains.academy.test.system.core.models.method.TestMethod
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import org.junit.jupiter.api.Test
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down Expand Up @@ -109,6 +109,11 @@ class Test {
)
}

@Test
fun smokeTest() {
runMainFunction(::main, List(maxAttemptsCount + 1) { "A$newLineSymbol" }.joinToString(""))
}

@ParameterizedTest
@MethodSource("functions")
fun testFunctions(function: TestMethod) {
Expand Down
3 changes: 3 additions & 0 deletions Hangman/Core/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.jetbrains.academy.test.system.core.models.method.TestMethod
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions Hangman/generateSecretFunction/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.jetbrains.academy.test.system.core.models.method.TestMethod
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import org.junit.jupiter.api.Test
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions Hangman/getHiddenSecretFunction/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.jetbrains.academy.test.system.core.models.method.TestMethod
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import org.junit.jupiter.api.Test
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions Hangman/getRoundResultsFunction/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.jetbrains.academy.test.system.core.models.method.TestMethod
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import org.junit.jupiter.api.Test
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions Hangman/isCompleteFunction/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.jetbrains.academy.test.system.core.models.method.TestMethod
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions Hangman/isCorrectInputFunction/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.jetbrains.academy.test.system.core.models.method.TestMethod
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import org.junit.jupiter.api.Test
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions Hangman/safeUserInputFunction/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.jetbrains.academy.test.system.core.models.method.TestMethod
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import org.junit.jupiter.api.Test
import util.*

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions LastPush/CanvasGapsGenerator/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*
import java.lang.reflect.InvocationTargetException

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
3 changes: 3 additions & 0 deletions LastPush/CanvasGenerator/test/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import org.jetbrains.academy.test.system.core.models.classes.findClassSafe
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import util.*
import java.lang.reflect.InvocationTargetException

@HandleNotImplementedError
@ExtendWith(HandleNotImplementedErrorExtension::class)
class Test {
companion object {
@JvmStatic
Expand Down
Loading

0 comments on commit d62de23

Please sign in to comment.