From 5e8c3e6dd708fc8ed4814aa450dd68a8385b89ba Mon Sep 17 00:00:00 2001 From: shamim-emon Date: Sun, 29 Sep 2024 16:24:33 +0600 Subject: [PATCH 1/4] Under dev --- .../java/com/ivy/domain/features/Features.kt | 1 + .../com/ivy/domain/features/IvyFeatures.kt | 13 ++++++++-- .../java/com/ivy/ui/FormatMoneyUseCase.kt | 24 +++++++++++++++++++ .../java/com/ivy/ui/FormatMoneyUseCaseTest.kt | 22 +++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt create mode 100644 shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt diff --git a/shared/domain/src/main/java/com/ivy/domain/features/Features.kt b/shared/domain/src/main/java/com/ivy/domain/features/Features.kt index fedb4c25f7..af043582b2 100644 --- a/shared/domain/src/main/java/com/ivy/domain/features/Features.kt +++ b/shared/domain/src/main/java/com/ivy/domain/features/Features.kt @@ -7,6 +7,7 @@ interface Features { val showTitleSuggestions: BoolFeature val showCategorySearchBar: BoolFeature val hideTotalBalance: BoolFeature + val showDecimalNumber: BoolFeature val allFeatures: List } diff --git a/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt b/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt index c2f80701c7..5b69bff358 100644 --- a/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt +++ b/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt @@ -8,7 +8,7 @@ class IvyFeatures @Inject constructor() : Features { override val sortCategoriesAlphabetically = BoolFeature( key = "sort_categories_alphabetically", - group = FeatureGroup.Other, + group = FeatureGroup.Category, name = "Sort Categories Alphabetically", description = "Sort income and expenses" + " categories alphabetically" @@ -52,6 +52,14 @@ class IvyFeatures @Inject constructor() : Features { defaultValue = false ) + override val showDecimalNumber = BoolFeature( + key = "show_decimal_number", + group = FeatureGroup.Other, + name = "Show Decimal Number", + description = "Show Decimal Number in amounts", + defaultValue = false + ) + override val allFeatures: List get() = listOf( sortCategoriesAlphabetically, @@ -59,6 +67,7 @@ class IvyFeatures @Inject constructor() : Features { compactCategoriesMode, showTitleSuggestions, showCategorySearchBar, - hideTotalBalance + hideTotalBalance, + showDecimalNumber ) } diff --git a/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt b/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt new file mode 100644 index 0000000000..bd1df20c79 --- /dev/null +++ b/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt @@ -0,0 +1,24 @@ +package com.ivy.ui + +import androidx.compose.runtime.Composable +import com.ivy.domain.features.Features +import java.text.DecimalFormat +import java.text.DecimalFormatSymbols +import java.util.Locale +import javax.inject.Inject + +class FormatMoneyUseCase @Inject constructor( + private val feature: Features +) { + private val decimalFormatSymbols = DecimalFormatSymbols(Locale.getDefault()) + private val formatter = DecimalFormat("#,##,##0", decimalFormatSymbols) + + @Composable + fun format(value: Double): String { + val showDecimal = feature.showDecimalNumber.asEnabledState() + return when (showDecimal) { + true -> value.toString() + else -> formatter.format(value) + } + } +} \ No newline at end of file diff --git a/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt b/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt new file mode 100644 index 0000000000..6835d9592c --- /dev/null +++ b/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt @@ -0,0 +1,22 @@ +package com.ivy.ui + +import com.google.testing.junit.testparameterinjector.TestParameterInjector +import com.ivy.base.time.TimeProvider +import com.ivy.domain.features.Features +import com.ivy.ui.time.TimeFormatter +import org.junit.Test +import org.junit.runner.RunWith +import io.kotest.matchers.shouldBe +import io.mockk.every +import io.mockk.mockk + + +@RunWith(TestParameterInjector::class) +class FormatMoneyUseCaseTest { + + @Test + fun `my test`(){ + val features = mockk() + 1 shouldBe 1 + } +} \ No newline at end of file From 1d77b567185d810c0cbb6e433816ad2936e15c71 Mon Sep 17 00:00:00 2001 From: shamim-emon Date: Sun, 29 Sep 2024 22:03:26 +0600 Subject: [PATCH 2/4] Under dev --- .../java/com/ivy/ui/FormatMoneyUseCase.kt | 14 +++--- .../java/com/ivy/ui/FormatMoneyUseCaseTest.kt | 50 +++++++++++++++---- 2 files changed, 48 insertions(+), 16 deletions(-) diff --git a/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt b/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt index bd1df20c79..477e53aa1a 100644 --- a/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt +++ b/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt @@ -2,23 +2,25 @@ package com.ivy.ui import androidx.compose.runtime.Composable import com.ivy.domain.features.Features +import com.ivy.ui.time.DevicePreferences import java.text.DecimalFormat import java.text.DecimalFormatSymbols import java.util.Locale import javax.inject.Inject class FormatMoneyUseCase @Inject constructor( - private val feature: Features + private val feature: Features, + private val devicePreferences: DevicePreferences, ) { - private val decimalFormatSymbols = DecimalFormatSymbols(Locale.getDefault()) - private val formatter = DecimalFormat("#,##,##0", decimalFormatSymbols) - + private val locale = devicePreferences.locale() + private val formatterWithoutDecimal = DecimalFormat("###,###", DecimalFormatSymbols(locale)) + private val formatterWithDecimal = DecimalFormat("###,###.00", DecimalFormatSymbols(locale)) @Composable fun format(value: Double): String { val showDecimal = feature.showDecimalNumber.asEnabledState() return when (showDecimal) { - true -> value.toString() - else -> formatter.format(value) + true -> formatterWithDecimal.format(value) + else -> formatterWithoutDecimal.format(value) } } } \ No newline at end of file diff --git a/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt b/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt index 6835d9592c..3014ae9176 100644 --- a/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt +++ b/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt @@ -1,22 +1,52 @@ package com.ivy.ui -import com.google.testing.junit.testparameterinjector.TestParameterInjector -import com.ivy.base.time.TimeProvider +import androidx.compose.runtime.Composable +import com.ivy.domain.features.BoolFeature +import com.ivy.domain.features.FeatureGroup import com.ivy.domain.features.Features -import com.ivy.ui.time.TimeFormatter -import org.junit.Test -import org.junit.runner.RunWith +import com.ivy.ui.time.DevicePreferences import io.kotest.matchers.shouldBe import io.mockk.every import io.mockk.mockk +import org.junit.Before +import org.junit.Test +import java.util.Locale - -@RunWith(TestParameterInjector::class) class FormatMoneyUseCaseTest { + private val features = mockk() + private val devicePreferences = mockk() + private val showDecimal = BoolFeature( + key = "show_decimal_number", + group = FeatureGroup.Other, + name = "Show Decimal Number", + description = "Show Decimal Number in amounts", + defaultValue = true + ) + + private val hideDecimal = BoolFeature( + key = "show_decimal_number", + group = FeatureGroup.Other, + name = "Show Decimal Number", + description = "Show Decimal Number in amounts", + defaultValue = false + ) + + private lateinit var formatMoneyUseCase: FormatMoneyUseCase + + @Before + fun setup() { + formatMoneyUseCase = FormatMoneyUseCase(features,devicePreferences) + } + + @Composable @Test - fun `my test`(){ - val features = mockk() - 1 shouldBe 1 + fun `Format with no decimal place locale ENGLISH`() { + //given + every { features.showDecimalNumber } returns hideDecimal + every { devicePreferences.locale() } returns Locale.ENGLISH + + val result = formatMoneyUseCase.format(value = 1000.12) + result shouldBe "1,000" } } \ No newline at end of file From 7b6406ba8618badb1039197716b9afed30873e5a Mon Sep 17 00:00:00 2001 From: shamim-emon Date: Mon, 30 Sep 2024 17:39:21 +0600 Subject: [PATCH 3/4] Decimal number capability added --- gradle/libs.versions.toml | 3 + .../com/ivy/domain/features/IvyFeatures.kt | 7 +- shared/ui/core/build.gradle.kts | 2 + .../java/com/ivy/ui/FormatMoneyUseCase.kt | 23 ++-- .../java/com/ivy/ui/FormatMoneyUseCaseTest.kt | 106 +++++++++++++----- 5 files changed, 101 insertions(+), 40 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 065c223f70..8270cf471a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -120,6 +120,9 @@ androidx-work = { module = "androidx.work:work-runtime-ktx", version.ref = "andr androidx-work-testing = { module = "androidx.work:work-testing", version.ref = "androidx-work" } androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.3.2" } +# Robolectric +roboelectric = { module = "org.robolectric:robolectric", version = "4.13" } + # Material material = { module = "com.google.android.material:material", version = "1.12.0" } diff --git a/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt b/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt index 5b69bff358..900a0b9b47 100644 --- a/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt +++ b/shared/domain/src/main/java/com/ivy/domain/features/IvyFeatures.kt @@ -56,8 +56,8 @@ class IvyFeatures @Inject constructor() : Features { key = "show_decimal_number", group = FeatureGroup.Other, name = "Show Decimal Number", - description = "Show Decimal Number in amounts", - defaultValue = false + description = "Whether to show the decimal part in amounts", + defaultValue = true ) override val allFeatures: List @@ -68,6 +68,9 @@ class IvyFeatures @Inject constructor() : Features { showTitleSuggestions, showCategorySearchBar, hideTotalBalance, + /* will be uncommented when this functionality + * will be available across the application in up-coming PRs showDecimalNumber + */ ) } diff --git a/shared/ui/core/build.gradle.kts b/shared/ui/core/build.gradle.kts index 7e79fb1fd9..5c4b5e4e41 100644 --- a/shared/ui/core/build.gradle.kts +++ b/shared/ui/core/build.gradle.kts @@ -9,4 +9,6 @@ android { dependencies { implementation(projects.shared.base) implementation(projects.shared.domain) + + testImplementation(libs.roboelectric) } \ No newline at end of file diff --git a/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt b/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt index 477e53aa1a..e35d20a2d4 100644 --- a/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt +++ b/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt @@ -1,26 +1,29 @@ package com.ivy.ui -import androidx.compose.runtime.Composable +import android.content.Context import com.ivy.domain.features.Features import com.ivy.ui.time.DevicePreferences +import dagger.hilt.android.qualifiers.ApplicationContext import java.text.DecimalFormat import java.text.DecimalFormatSymbols -import java.util.Locale import javax.inject.Inject class FormatMoneyUseCase @Inject constructor( private val feature: Features, private val devicePreferences: DevicePreferences, + @ApplicationContext private val context: Context ) { + private val locale = devicePreferences.locale() - private val formatterWithoutDecimal = DecimalFormat("###,###", DecimalFormatSymbols(locale)) - private val formatterWithDecimal = DecimalFormat("###,###.00", DecimalFormatSymbols(locale)) - @Composable - fun format(value: Double): String { - val showDecimal = feature.showDecimalNumber.asEnabledState() - return when (showDecimal) { - true -> formatterWithDecimal.format(value) - else -> formatterWithoutDecimal.format(value) + private val withoutDecimalFormatter = DecimalFormat("###,###", DecimalFormatSymbols(locale)) + private val withDecimalFormatter = DecimalFormat("###,###.00", DecimalFormatSymbols(locale)) + + suspend fun format(value: Double): String { + val showDecimalPoint = feature.showDecimalNumber.isEnabled(context) + + return when (showDecimalPoint) { + true -> withDecimalFormatter.format(value) + false -> withoutDecimalFormatter.format(value) } } } \ No newline at end of file diff --git a/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt b/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt index 3014ae9176..6c5f66455b 100644 --- a/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt +++ b/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt @@ -1,52 +1,102 @@ package com.ivy.ui -import androidx.compose.runtime.Composable +import android.content.Context +import androidx.test.platform.app.InstrumentationRegistry import com.ivy.domain.features.BoolFeature import com.ivy.domain.features.FeatureGroup import com.ivy.domain.features.Features import com.ivy.ui.time.DevicePreferences +import io.kotest.common.runBlocking import io.kotest.matchers.shouldBe import io.mockk.every import io.mockk.mockk -import org.junit.Before import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.ParameterizedRobolectricTestRunner import java.util.Locale -class FormatMoneyUseCaseTest { +@RunWith(ParameterizedRobolectricTestRunner::class) +class FormatMoneyUseCaseTest(private val param: TestData) { + private val context: Context = InstrumentationRegistry.getInstrumentation().context private val features = mockk() private val devicePreferences = mockk() - private val showDecimal = BoolFeature( - key = "show_decimal_number", - group = FeatureGroup.Other, - name = "Show Decimal Number", - description = "Show Decimal Number in amounts", - defaultValue = true - ) - private val hideDecimal = BoolFeature( - key = "show_decimal_number", - group = FeatureGroup.Other, - name = "Show Decimal Number", - description = "Show Decimal Number in amounts", - defaultValue = false + class TestData( + val givenInput: Double, + val showDecimal: BoolFeature, + val locale: Locale, + val expectedOutPut: String ) private lateinit var formatMoneyUseCase: FormatMoneyUseCase - @Before - fun setup() { - formatMoneyUseCase = FormatMoneyUseCase(features,devicePreferences) - } - - @Composable @Test - fun `Format with no decimal place locale ENGLISH`() { - //given - every { features.showDecimalNumber } returns hideDecimal - every { devicePreferences.locale() } returns Locale.ENGLISH + fun `validate decimal formatting`(): Unit = runBlocking { + // given + every { features.showDecimalNumber } returns param.showDecimal + every { devicePreferences.locale() } returns param.locale + formatMoneyUseCase = FormatMoneyUseCase(features, devicePreferences, context) + + // when + val result = formatMoneyUseCase.format(value = param.givenInput) + + // then + result shouldBe param.expectedOutPut + } - val result = formatMoneyUseCase.format(value = 1000.12) - result shouldBe "1,000" + companion object { + @JvmStatic + @ParameterizedRobolectricTestRunner.Parameters(name = "Input: {0}") + fun params() = listOf( + TestData( + givenInput = 1000.12, + showDecimal = BoolFeature( + key = "show_decimal_number", + group = FeatureGroup.Other, + name = "Show Decimal Number", + description = "Whether to show the decimal part in amounts", + defaultValue = true + ), + locale = Locale.ENGLISH, + expectedOutPut = "1,000.12" + ), + TestData( + givenInput = 1000.12, + showDecimal = BoolFeature( + key = "show_decimal_number", + group = FeatureGroup.Other, + name = "Show Decimal Number", + description = "Whether to show the decimal part in amounts", + defaultValue = false + ), + locale = Locale.ENGLISH, + expectedOutPut = "1,000" + ), + TestData( + givenInput = 1000.12, + showDecimal = BoolFeature( + key = "show_decimal_number", + group = FeatureGroup.Other, + name = "Show Decimal Number", + description = "Whether to show the decimal part in amounts", + defaultValue = true + ), + locale = Locale.GERMAN, + expectedOutPut = "1.000,12" + ), + TestData( + givenInput = 1000.12, + showDecimal = BoolFeature( + key = "show_decimal_number", + group = FeatureGroup.Other, + name = "Show Decimal Number", + description = "Whether to show the decimal part in amounts", + defaultValue = false + ), + locale = Locale.GERMAN, + expectedOutPut = "1.000" + ), + ) } } \ No newline at end of file From c109772c272e66ad9dd113917cdde261287481cd Mon Sep 17 00:00:00 2001 From: shamim-emon Date: Mon, 30 Sep 2024 21:21:22 +0600 Subject: [PATCH 4/4] Decimal number capability added : Reviews resolved --- gradle/libs.versions.toml | 3 - shared/ui/core/build.gradle.kts | 2 - .../java/com/ivy/ui/FormatMoneyUseCase.kt | 4 +- .../java/com/ivy/ui/FormatMoneyUseCaseTest.kt | 115 +++++++----------- 4 files changed, 45 insertions(+), 79 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8270cf471a..065c223f70 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -120,9 +120,6 @@ androidx-work = { module = "androidx.work:work-runtime-ktx", version.ref = "andr androidx-work-testing = { module = "androidx.work:work-testing", version.ref = "androidx-work" } androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.3.2" } -# Robolectric -roboelectric = { module = "org.robolectric:robolectric", version = "4.13" } - # Material material = { module = "com.google.android.material:material", version = "1.12.0" } diff --git a/shared/ui/core/build.gradle.kts b/shared/ui/core/build.gradle.kts index 5c4b5e4e41..7e79fb1fd9 100644 --- a/shared/ui/core/build.gradle.kts +++ b/shared/ui/core/build.gradle.kts @@ -9,6 +9,4 @@ android { dependencies { implementation(projects.shared.base) implementation(projects.shared.domain) - - testImplementation(libs.roboelectric) } \ No newline at end of file diff --git a/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt b/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt index e35d20a2d4..bc0114e044 100644 --- a/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt +++ b/shared/ui/core/src/main/java/com/ivy/ui/FormatMoneyUseCase.kt @@ -9,7 +9,7 @@ import java.text.DecimalFormatSymbols import javax.inject.Inject class FormatMoneyUseCase @Inject constructor( - private val feature: Features, + private val features: Features, private val devicePreferences: DevicePreferences, @ApplicationContext private val context: Context ) { @@ -19,7 +19,7 @@ class FormatMoneyUseCase @Inject constructor( private val withDecimalFormatter = DecimalFormat("###,###.00", DecimalFormatSymbols(locale)) suspend fun format(value: Double): String { - val showDecimalPoint = feature.showDecimalNumber.isEnabled(context) + val showDecimalPoint = features.showDecimalNumber.isEnabled(context) return when (showDecimalPoint) { true -> withDecimalFormatter.format(value) diff --git a/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt b/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt index 6c5f66455b..4a98251c3f 100644 --- a/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt +++ b/shared/ui/core/src/test/java/com/ivy/ui/FormatMoneyUseCaseTest.kt @@ -1,102 +1,73 @@ package com.ivy.ui import android.content.Context -import androidx.test.platform.app.InstrumentationRegistry -import com.ivy.domain.features.BoolFeature -import com.ivy.domain.features.FeatureGroup +import com.google.testing.junit.testparameterinjector.TestParameter +import com.google.testing.junit.testparameterinjector.TestParameterInjector import com.ivy.domain.features.Features import com.ivy.ui.time.DevicePreferences import io.kotest.common.runBlocking import io.kotest.matchers.shouldBe +import io.mockk.coEvery import io.mockk.every import io.mockk.mockk import org.junit.Test import org.junit.runner.RunWith -import org.robolectric.ParameterizedRobolectricTestRunner import java.util.Locale -@RunWith(ParameterizedRobolectricTestRunner::class) -class FormatMoneyUseCaseTest(private val param: TestData) { +@RunWith(TestParameterInjector::class) +class FormatMoneyUseCaseTest { - private val context: Context = InstrumentationRegistry.getInstrumentation().context private val features = mockk() private val devicePreferences = mockk() - class TestData( - val givenInput: Double, - val showDecimal: BoolFeature, + enum class MoneyFormatterTestCase( + val amount: Double, + val showDecimal: Boolean, val locale: Locale, - val expectedOutPut: String - ) + val expectedOutput: String + ) { + ENG_SHOW_DECIMAL( + amount = 1000.12, + showDecimal = true, + locale = Locale.ENGLISH, + expectedOutput = "1,000.12" + ), + ENG_HIDE_DECIMAL( + amount = 1000.12, + showDecimal = false, + locale = Locale.ENGLISH, + expectedOutput = "1,000" + ), + GERMAN_SHOW_DECIMAL( + amount = 1000.12, + showDecimal = true, + locale = Locale.GERMAN, + expectedOutput = "1.000,12" + ), + GERMAN_HIDE_DECIMAL( + amount = 1000.12, + showDecimal = false, + locale = Locale.GERMAN, + expectedOutput = "1.000" + ), + } private lateinit var formatMoneyUseCase: FormatMoneyUseCase @Test - fun `validate decimal formatting`(): Unit = runBlocking { + fun `validate decimal formatting`( + @TestParameter testCase: MoneyFormatterTestCase + ): Unit = runBlocking { // given - every { features.showDecimalNumber } returns param.showDecimal - every { devicePreferences.locale() } returns param.locale + val context = mockk() + every { features.showDecimalNumber } returns mockk { coEvery { isEnabled(any()) } returns testCase.showDecimal } + every { devicePreferences.locale() } returns testCase.locale formatMoneyUseCase = FormatMoneyUseCase(features, devicePreferences, context) // when - val result = formatMoneyUseCase.format(value = param.givenInput) + val result = formatMoneyUseCase.format(value = testCase.amount) // then - result shouldBe param.expectedOutPut - } - - companion object { - @JvmStatic - @ParameterizedRobolectricTestRunner.Parameters(name = "Input: {0}") - fun params() = listOf( - TestData( - givenInput = 1000.12, - showDecimal = BoolFeature( - key = "show_decimal_number", - group = FeatureGroup.Other, - name = "Show Decimal Number", - description = "Whether to show the decimal part in amounts", - defaultValue = true - ), - locale = Locale.ENGLISH, - expectedOutPut = "1,000.12" - ), - TestData( - givenInput = 1000.12, - showDecimal = BoolFeature( - key = "show_decimal_number", - group = FeatureGroup.Other, - name = "Show Decimal Number", - description = "Whether to show the decimal part in amounts", - defaultValue = false - ), - locale = Locale.ENGLISH, - expectedOutPut = "1,000" - ), - TestData( - givenInput = 1000.12, - showDecimal = BoolFeature( - key = "show_decimal_number", - group = FeatureGroup.Other, - name = "Show Decimal Number", - description = "Whether to show the decimal part in amounts", - defaultValue = true - ), - locale = Locale.GERMAN, - expectedOutPut = "1.000,12" - ), - TestData( - givenInput = 1000.12, - showDecimal = BoolFeature( - key = "show_decimal_number", - group = FeatureGroup.Other, - name = "Show Decimal Number", - description = "Whether to show the decimal part in amounts", - defaultValue = false - ), - locale = Locale.GERMAN, - expectedOutPut = "1.000" - ), - ) + result shouldBe testCase.expectedOutput } } \ No newline at end of file