Skip to content

Commit 798c701

Browse files
committed
Update test class name
1 parent 1be3029 commit 798c701

File tree

69 files changed

+141
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+141
-72
lines changed

misc/template/puzzle/challange.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun puzzle() {
77

88
}
99

10-
class PuzzleTest {
10+
private class Test {
1111
@Test
1212
fun `simple test`() {
1313
"value" shouldBeEqualTo "value"

src/test/kotlin/com/igorwojda/binarytree/insert/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ private data class Node<E : Comparable<E>>(
1717
}
1818
}
1919

20-
class BinarySearchTreeTest {
20+
private class Test {
2121
@Test
2222
fun `can insert correctly`() {
2323
// -- -------Tree------------

src/test/kotlin/com/igorwojda/binarytree/validate/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun isValidSearchBinaryTree(node: Node<Int>): Boolean {
77
TODO("not implemented")
88
}
99

10-
class IsValidSearchBinaryTreeTest {
10+
private class Test {
1111
@Test
1212
fun `Validate recognizes a valid BST`() {
1313
// -- -------Tree------------

src/test/kotlin/com/igorwojda/integer/addupto/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun addUpTo(n: Int): Int {
77
TODO("not implemented")
88
}
99

10-
class AddUpToTest {
10+
private class Test {
1111
@Test
1212
fun `add up to 1`() {
1313
addUpTo(1) shouldBeEqualTo 1

src/test/kotlin/com/igorwojda/integer/countdown/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun countDown(n: Int): List<Int> {
77
TODO("not implemented")
88
}
99

10-
class CountDownTest {
10+
private class Test {
1111
@Test
1212
fun `count down 0`() {
1313
countDown(0) shouldBeEqualTo listOf(0)

src/test/kotlin/com/igorwojda/integer/countupanddown/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun countUpAndDown(n: Int): List<Int> {
77
TODO("not implemented")
88
}
99

10-
class CountUpAndDownTest {
10+
private class Test {
1111
@Test
1212
fun `count up and down 0`() {
1313
countUpAndDown(0) shouldBeEqualTo listOf(0)

src/test/kotlin/com/igorwojda/integer/digitfrequency/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun equalDigitFrequency(i1: Int, i2: Int): Boolean {
77
TODO("not implemented")
88
}
99

10-
class DigitFrequencyTest {
10+
private class Test {
1111
@Test
1212
fun `"789" and "897" have the same digit frequency`() {
1313
equalDigitFrequency(789, 897) shouldBeEqualTo true

src/test/kotlin/com/igorwojda/integer/fibonacci/basic/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun fibonacci(n: Int): Int {
77
TODO("not implemented")
88
}
99

10-
class FibonacciSeriesTest {
10+
private class Test {
1111
@Test
1212
fun `calculates correct fib value for 0`() {
1313
fibonacci(0) shouldBeEqualTo 0

src/test/kotlin/com/igorwojda/integer/fibonacci/recursivecached/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ private fun fibonacciSequenceRecursiveCached(n: Int, methodCache: MutableList<Me
1515

1616
private data class MethodCache(val n: Int, val result: Int)
1717

18-
class FibonacciSeriesRecursiveMethodCacheTest {
18+
private class Test {
1919
@Test
2020
fun `calculates correct fib value for 0`() {
2121
fibonacciSequenceRecursiveCached(0) shouldBeEqualTo 0

src/test/kotlin/com/igorwojda/integer/fizzbuzz/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun fizzBuzz(n: Int): List<String> {
77
TODO("not implemented")
88
}
99

10-
class FizzBuzzTest {
10+
private class Test {
1111

1212
@Test
1313
fun `Calling fizzbuzz with "5" returns list with 5 items`() {

src/test/kotlin/com/igorwojda/integer/generateallpairs/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun getAllPairs(n: Int): List<Pair<Int, Int>> {
77
TODO("not implemented")
88
}
99

10-
class GetAllPairsTest {
10+
private class Test {
1111
@Test
1212
fun `get all pairs 0`() {
1313
getAllPairs(0) shouldBeEqualTo listOf(0 to 0)

src/test/kotlin/com/igorwojda/integer/getodd/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun filterOdd(list: List<Int>): List<Int> {
77
TODO("not implemented")
88
}
99

10-
class GetOddNumbersTest {
10+
private class Test {
1111
@Test
1212
fun `empty list returns empty list`() {
1313
filterOdd(listOf()) shouldBeEqualTo emptyList()

src/test/kotlin/com/igorwojda/integer/power/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun power(base: Int, exponent: Int): Int {
77
TODO("not implemented")
88
}
99

10-
class PowerTest {
10+
private class Test {
1111
@Test
1212
fun `power 2^1 returns 2`() {
1313
power(2, 1) shouldBeEqualTo 2

src/test/kotlin/com/igorwojda/integer/pyramidgenerator/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fun generatePyramid(n: Int): List<String> {
77
TODO("not implemented")
88
}
99

10-
class PyramidGeneratorTest {
10+
private class Test {
1111

1212
@Test
1313
fun `pyramid n = 2`() {

src/test/kotlin/com/igorwojda/integer/reverse/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun reverseInt(i: Int): Int {
77
TODO("not implemented")
88
}
99

10-
class ReverseIntTest {
10+
private class Test {
1111
@Test
1212
fun `ReverseInt handles 0 as an input`() {
1313
reverseInt(0) shouldBeEqualTo 0

src/test/kotlin/com/igorwojda/integer/stepsgenerator/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fun generateSteps(n: Int): List<String> {
77
TODO("not implemented")
88
}
99

10-
class StepsTest {
10+
private class Test {
1111
@Test
1212
fun `steps n = 1`() {
1313
val result = generateSteps(1)

src/test/kotlin/com/igorwojda/linkedlist/doubly/base/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ private data class Node<T>(
1010
var next: Node<T>? = null
1111
)
1212

13-
class DoublyLinkedListTest {
13+
private class Test {
1414
// @Test
1515
// fun `when list is created head node is null`() {
1616
// DoublyLinkedList<Int>().apply {

src/test/kotlin/com/igorwojda/linkedlist/singly/base/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ private data class Node<T>(
99
var next: Node<T>? = null
1010
)
1111

12-
class SinglyLinkedListTest {
12+
private class Test {
1313
// @Test
1414
// fun `when list is created head node is null`() {
1515
// SinglyLinkedList<Int>().apply {

src/test/kotlin/com/igorwojda/linkedlist/singly/circularcheck/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ private fun circularCheck(list: SinglyLinkedList<Char>): Boolean {
99
TODO("not implemented")
1010
}
1111

12-
class CircularTest {
12+
private class Test {
1313
@Test
1414
fun `circular detects circular linked lists`() {
1515
val l = SinglyLinkedList<Char>()

src/test/kotlin/com/igorwojda/linkedlist/singly/fromlast/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ private fun fromLast(list: SinglyLinkedList<Char>, endIndex: Int): Node<Char>? {
99
TODO("not implemented")
1010
}
1111

12-
class FromLastTest {
12+
private class Test {
1313
@Test
1414
fun `returns the node 0 elements from the end`() {
1515
SinglyLinkedList<Char>().apply {

src/test/kotlin/com/igorwojda/linkedlist/singly/midpoint/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ private fun midpoint(list: Solution.SinglyLinkedList<Char>): Node<Char>? {
1010
TODO("not implemented")
1111
}
1212

13-
class MidpointTest {
13+
private class Test {
1414
@Test
1515
fun `midpoint of list with 0 elements`() {
1616
SinglyLinkedList<Char>().apply {

src/test/kotlin/com/igorwojda/list/capitalizeFirst/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun capitalizeFirst(list: List<String>): List<String> {
77
TODO("not implemented")
88
}
99

10-
class CapitalizeFirstTest {
10+
private class Test {
1111
@Test
1212
fun `capitalize list with one string`() {
1313
capitalizeFirst(listOf("igor")) shouldBeEqualTo listOf("Igor")

src/test/kotlin/com/igorwojda/list/countuniquevalues/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun countUniqueValues(list: List<Int>): Int {
77
TODO("not implemented")
88
}
99

10-
class CountUniqueValuesTest {
10+
private class Test {
1111
@Test
1212
fun `countUniqueValues empty list return 0`() {
1313
countUniqueValues(listOf()) shouldBeEqualTo 0

src/test/kotlin/com/igorwojda/list/flatten/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fun flatten(list: List<*>): List<*> {
77
TODO("not implemented")
88
}
99

10-
class FlattenTest {
10+
private class Test {
1111
@Test
1212
fun `flatten test 1`() {
1313
flatten(listOf(1)) shouldBeEqualTo listOf(1)

src/test/kotlin/com/igorwojda/list/formattrainroute/challenge.kt

+2-7
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,15 @@ private fun formatTrainRoute(stations: List<String>): String {
77
TODO("not implemented")
88
}
99

10-
class TrainRouteTest {
10+
private class Test {
1111
@Test
1212
fun `formatTrainRoute list "Luton"`() {
1313
formatTrainRoute(listOf("Luton")) shouldBeEqualTo "Train is calling at Luton"
1414
}
1515

1616
@Test
1717
fun `formatTrainRoute list "Luton", "Harpenden"`() {
18-
formatTrainRoute(
19-
listOf(
20-
"Luton",
21-
"Harpenden"
22-
)
23-
) shouldBeEqualTo "Train is calling at Luton and Harpenden"
18+
formatTrainRoute(listOf("Luton", "Harpenden")) shouldBeEqualTo "Train is calling at Luton and Harpenden"
2419
}
2520

2621
@Test

src/test/kotlin/com/igorwojda/list/listchunk/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun chunk(list: List<Int>, size: Int): List<List<Int>> {
77
TODO("not implemented")
88
}
99

10-
class ListChunkTest {
10+
private class Test {
1111
@Test
1212
fun `chunk divides an list of 10 elements with chunk size 2`() {
1313
val list = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

src/test/kotlin/com/igorwojda/list/maxsublistsum/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ private fun max(i1: Int?, i2: Int?): Int? {
1717
}
1818
}
1919

20-
class MaxSubListTest {
20+
private class Test {
2121
@Test
2222
fun `max sublist sum for list 4, 2, 7 and n 2 `() {
2323
maxSubListSum(listOf(4, 2, 7), 2) shouldBeEqualTo 9

src/test/kotlin/com/igorwojda/list/minsublistlength/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private fun min(i1: Int?, i2: Int?): Int? {
1616
}
1717
}
1818

19-
class MinSubListLengthTest {
19+
private class Test {
2020
@Test
2121
fun `min sub list sum empty list and 7 returns 0`() {
2222
minSubListLength(listOf(), 7) shouldBeEqualTo 0

src/test/kotlin/com/igorwojda/list/pairaverage/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ inline fun <K, V> MutableMap<K, V>.incrementExisting(key: K, value: V) {
1919
put(key, value)
2020
}
2121

22-
class TargetAverageTest {
22+
private class Test {
2323
@Test
2424
fun `empty list return false`() {
2525
hasAverage(listOf(), 1.0) shouldBeEqualTo false

src/test/kotlin/com/igorwojda/list/product/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun product(list: List<Int>): Int {
77
TODO("not implemented")
88
}
99

10-
class ProductTest {
10+
private class Test {
1111
@Test
1212
fun `product 0 returns 0`() {
1313
product(listOf(0)) shouldBeEqualTo 0

src/test/kotlin/com/igorwojda/list/search/binarysearch/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun binarySearch(list: List<Char>, element: Char): Int {
77
TODO("not implemented")
88
}
99

10-
class BinarySearchTest {
10+
private class Test {
1111
@Test
1212
fun `index of A in A, B, C is 0`() {
1313
binarySearch(listOf('A', 'B', 'C'), 'A') shouldBeEqualTo 0

src/test/kotlin/com/igorwojda/list/search/linearsearch/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun getIndex(list: List<String>, str: String): Int {
77
TODO("not implemented")
88
}
99

10-
class LinearSearchTest {
10+
private class Test {
1111
@Test
1212
fun `index of 'A' in 'A, B, C' is 0`() {
1313
getIndex(listOf("A", "B", "C"), "A") shouldBeEqualTo 0

src/test/kotlin/com/igorwojda/list/sort/bubblesort/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun bubbleSort(list: List<Int>): List<Number> {
77
TODO("not implemented")
88
}
99

10-
class BubbleSortTest {
10+
private class Test {
1111
@Test
1212
fun `bubble sort empty list`() {
1313
bubbleSort(mutableListOf()) shouldBeEqualTo listOf()

src/test/kotlin/com/igorwojda/list/sort/insertionsort/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun insertionSort(list: MutableList<Int>): List<Int> {
77
TODO("not implemented")
88
}
99

10-
class InsertionSortTest {
10+
private class Test {
1111
@Test
1212
fun `insertion sort empty list`() {
1313
insertionSort(mutableListOf()) shouldBeEqualTo listOf()

src/test/kotlin/com/igorwojda/list/sort/mergesort/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ private fun mergeSort(list: List<Int>): List<Int> {
1212
TODO("not implemented")
1313
}
1414

15-
class MergeSortTest {
15+
private class Test {
1616
@Test
1717
fun `merge sort empty list`() {
1818
mergeSort(mutableListOf()) shouldBeEqualTo listOf()

src/test/kotlin/com/igorwojda/list/sort/quicksort/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ private fun <T> MutableList<T>.swap(index1: Int, index2: Int) {
1313
this[index2] = tmp
1414
}
1515

16-
class QuickSortTest {
16+
private class Test {
1717
@Test
1818
fun `quick sort empty list`() {
1919
quickSort(mutableListOf()) shouldBeEqualTo listOf()

src/test/kotlin/com/igorwojda/list/sort/radixsort/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ private val Int.digitCount get() = -1
1515

1616
private fun maxDigits(list: List<Int>): Int = -1
1717

18-
class RadixSortTest {
18+
private class Test {
1919
@Test
2020
fun `getDigitAt at 0 for 123 is 1`() {
2121
123.getDigitAt(0) shouldBeEqualTo '3'

src/test/kotlin/com/igorwojda/list/sort/selectionsort/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun selectionSort(list: List<Int>): List<Number> {
77
return list
88
}
99

10-
class SelectionSortTest {
10+
private class Test {
1111
@Test
1212
fun `selection sort empty list`() {
1313
selectionSort(mutableListOf()) shouldBeEqualTo listOf()

src/test/kotlin/com/igorwojda/list/squareequal/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun squareEquals(list: List<Int>, squared: List<Int>): Boolean {
77
TODO("not implemented")
88
}
99

10-
class SquareEqualsTest {
10+
private class Test {
1111
@Test
1212
fun `square 2 equal square 4`() {
1313
squareEquals(listOf(2), listOf(4)) shouldBeEqualTo true

src/test/kotlin/com/igorwojda/list/subtract/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun getSubtraction(list1: List<String>, list2: List<String>): List<Strin
77
TODO("not implemented")
88
}
99

10-
class SubtractTest {
10+
private class Test {
1111
@Test
1212
fun `A, B, C and B ,C returns A`() {
1313
getSubtraction(listOf("A", "B", "C"), listOf("B", "C")) shouldBeEqualTo listOf("A")

src/test/kotlin/com/igorwojda/list/sumzero/challenge.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private fun sumZero(list: List<Int>): Pair<Int, Int>? {
77
TODO("not implemented")
88
}
99

10-
class SumZeroTest {
10+
private class Test {
1111
@Test
1212
fun `sumZero empty list return null`() {
1313
sumZero(listOf()) shouldBeEqualTo null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.igorwojda.matrix.findimage
2+
3+
import org.amshove.kluent.shouldBeEqualTo
4+
import org.junit.jupiter.api.Test
5+
6+
private fun puzzle() {
7+
8+
}
9+
10+
private class Test {
11+
@Test
12+
fun `simple test`() {
13+
"value" shouldBeEqualTo "value"
14+
}
15+
}

0 commit comments

Comments
 (0)