Skip to content

v3.0.0

Compare
Choose a tag to compare
@idugalic idugalic released this 04 Jan 16:05
· 583 commits to main since this release

Version 3.0.0 is a reactive and multiplatform version of fmodel libraries optimized for Event sourcing, CQRS, and Domain Modeling.

What's Changed

Tests example

class DeciderTest : FunSpec({
    val evenDecider = evenNumberDecider()
    val oddDecider = oddNumberDecider()

    test("Event-sourced Decider - add even number") {
        with(evenDecider) {
            givenEvents(emptyList()) {
                whenCommand(AddEvenNumber(Description("2"), NumberValue(2)))
            } thenEvents listOf(EvenNumberAdded(Description("2"), NumberValue(2)))
        }
    }

    test("Event-sourced Decider - given previous state, add even number") {
        with(evenDecider) {
            givenEvents(listOf(EvenNumberAdded(Description("2"), NumberValue(2)))) {
                whenCommand(AddEvenNumber(Description("4"), NumberValue(4)))
            } thenEvents listOf(EvenNumberAdded(Description("4"), NumberValue(4)))
        }
    }
})

https://github.com/fraktalio/fmodel/blob/main/domain/src/commonTest/kotlin/com.fraktalio.fmodel.domain/DeciderTest.kt