Skip to content

Commit

Permalink
Add failing test for PersistenceLifecycleEvent in a typed actor
Browse files Browse the repository at this point in the history
  • Loading branch information
Yakimych committed Jan 15, 2021
1 parent 294f6d8 commit c9dc995
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/Akkling.Tests/PersistenceApi.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// <copyright file="FsApi.fs" company="Akka.NET Project">
// Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
// Copyright (C) 2013-2015 Akka.NET project <https://github.com/akkadotnet/akka.net>
Expand Down Expand Up @@ -104,4 +104,18 @@ let ``PersistenceLifecycleEvent should be fired``() = testDefault <| fun tck ->
loop ())
expectMsg tck ReplaySucceed |> ignore


[<Fact>]
let ``PersistenceLifecycleEvent should be fired in typed actor``() = testDefault <| fun tck ->
let pref = spawn tck "typed-p-1" <| propsPersist (fun (ctx: Eventsourced<string>) ->
let rec loop () = actor {
// let! (msg: obj) = ctx.Receive() // Does not compile
let! stringMsg = ctx.Receive()
let msg = stringMsg :> obj

match msg with
| :? PersistentLifecycleEvent as e ->
typed tck.TestActor <! e
return! loop ()
| _ -> return Unhandled }
loop ())
expectMsg tck ReplaySucceed |> ignore

0 comments on commit c9dc995

Please sign in to comment.