Akka.Persistence.Tests.SnapshotFailureRobustnessSpec.PersistentActor_with_a_failing_snapshot_should_recover_state_starting_from_the_most_recent_complete_snapshot C# (CSharp) Метод

PersistentActor_with_a_failing_snapshot_should_recover_state_starting_from_the_most_recent_complete_snapshot() приватный Метод

        public void PersistentActor_with_a_failing_snapshot_should_recover_state_starting_from_the_most_recent_complete_snapshot()
        {
            var spref = Sys.ActorOf(Props.Create(() => new SaveSnapshotTestActor(Name, TestActor)));
            var persistenceId = Name;

            ExpectMsg<RecoveryCompleted>();
            spref.Tell(new Cmd("blahonga"));
            ExpectMsg(1L);
            spref.Tell(new Cmd("kablama"));
            ExpectMsg(2L);
            Sys.EventStream.Subscribe(TestActor, typeof (Error));
            // TODO for some reason filtering doesn't work
            // var filter = EventFilter.Error(start: "Error loading snapshot").Mute();
            try
            {
                var lpref = Sys.ActorOf(Props.Create(() => new LoadSnapshotTestActor(Name, TestActor)));
                ExpectMsg<Error>(m => m.Message.ToString().StartsWith("Error loading snapshot"));
                ExpectMsg<SnapshotOffer>(m => m.Metadata.PersistenceId.Equals(persistenceId) &&
                                              m.Metadata.SequenceNr == 1 && m.Metadata.Timestamp > SnapshotMetadata.TimestampNotSpecified &&
                                              m.Snapshot.Equals("blahonga"));
                ExpectMsg("kablama-2");
                ExpectMsg<RecoveryCompleted>();
                ExpectNoMsg(TimeSpan.FromSeconds(1));
            }
            finally
            {
                Sys.EventStream.Unsubscribe(TestActor, typeof (Error));
                //filter.Unmute();
            }
        }