Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed Jul 9, 2024
1 parent cf8b814 commit 68dd231
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class ArbTransactionTest {
@Test
fun `arb income respects passed params`(
@TestParameter settled: Boolean,
@TestParameter removed: Boolean,
) = runTest {
// given
val transactionId = ModelFixtures.TransactionId
Expand All @@ -46,7 +45,6 @@ class ArbTransactionTest {
categoryId = Some(categoryId),
settled = Some(settled),
time = Some(ArbTime.Exactly(now)),
removed = Some(removed),
amount = Some(amount),
asset = Some(asset),
id = Some(transactionId),
Expand All @@ -57,7 +55,6 @@ class ArbTransactionTest {
income.account shouldBe accountId
income.category shouldBe categoryId
income.settled shouldBe settled
income.removed shouldBe removed
income.time shouldBe now
income.value shouldBe PositiveValue(amount, asset)
}
Expand All @@ -73,7 +70,6 @@ class ArbTransactionTest {
@Test
fun `arb expense respects passed params`(
@TestParameter settled: Boolean,
@TestParameter removed: Boolean,
) = runTest {
// given
val transactionId = ModelFixtures.TransactionId
Expand All @@ -90,7 +86,6 @@ class ArbTransactionTest {
categoryId = Some(categoryId),
settled = Some(settled),
time = Some(ArbTime.Exactly(now)),
removed = Some(removed),
amount = Some(amount),
asset = Some(asset),
id = Some(transactionId),
Expand All @@ -101,7 +96,6 @@ class ArbTransactionTest {
expense.account shouldBe accountId
expense.category shouldBe categoryId
expense.settled shouldBe settled
expense.removed shouldBe removed
expense.time shouldBe now
expense.value shouldBe PositiveValue(amount, asset)
}
Expand All @@ -117,7 +111,6 @@ class ArbTransactionTest {
@Test
fun `arb transfer respects passed params`(
@TestParameter settled: Boolean,
@TestParameter removed: Boolean,
) = runTest {
// given
val transactionId = ModelFixtures.TransactionId
Expand All @@ -136,7 +129,6 @@ class ArbTransactionTest {
categoryId = Some(categoryId),
settled = Some(settled),
time = Some(ArbTime.Exactly(now)),
removed = Some(removed),
id = Some(transactionId),
fromAccount = Some(fromAccount),
fromAmount = Some(fromAmount),
Expand All @@ -150,7 +142,6 @@ class ArbTransactionTest {
transfer.id shouldBe transactionId
transfer.category shouldBe categoryId
transfer.settled shouldBe settled
transfer.removed shouldBe removed
transfer.time shouldBe now
transfer.fromAccount shouldBe fromAccount
transfer.fromValue shouldBe PositiveValue(fromAmount, fromAsset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package com.ivy.data.model.primitive
import com.ivy.data.model.AccountId
import com.ivy.data.model.Expense
import com.ivy.data.model.Income
import com.ivy.data.model.PositiveValue
import com.ivy.data.model.TransactionId
import com.ivy.data.model.TransactionMetadata
import com.ivy.data.model.Transfer
import com.ivy.data.model.PositiveValue
import com.ivy.data.model.getFromAccount
import com.ivy.data.model.getFromValue
import com.ivy.data.model.getToAccount
Expand Down Expand Up @@ -142,8 +142,6 @@ class TransactionTest {
paidForDateTime = null,
loanRecordId = null
),
lastUpdated = Instant.EPOCH,
removed = false,
tags = listOf(),
value = PositiveValue(
amount = PositiveDouble.unsafe(1.0),
Expand All @@ -165,8 +163,6 @@ class TransactionTest {
paidForDateTime = null,
loanRecordId = null
),
lastUpdated = Instant.EPOCH,
removed = false,
tags = listOf(),
value = PositiveValue(
amount = PositiveDouble.unsafe(1.0),
Expand All @@ -188,8 +184,6 @@ class TransactionTest {
paidForDateTime = null,
loanRecordId = null
),
lastUpdated = Instant.EPOCH,
removed = false,
tags = listOf(),
fromAccount = AccountId,
fromValue = PositiveValue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ExportCsvUseCasePropertyTest {
}.map {
Arb.account(accountId = Some(it)).next()
}
coEvery { accountRepository.findAll(any()) } returns accounts
coEvery { accountRepository.findAll() } returns accounts
val categories = trns
.mapNotNull(Transaction::category)
.map {
Expand All @@ -65,7 +65,7 @@ class ExportCsvUseCasePropertyTest {
this
}
}
coEvery { categoryRepository.findAll(any()) } returns categories
coEvery { categoryRepository.findAll() } returns categories

// when
val csv = useCase.exportCsv { trns }
Expand Down

0 comments on commit 68dd231

Please sign in to comment.