示例#1
0
        public void Test_deserialization()
        {
            //CoffeMakeFailedEvent
            var msg = new Akka.Actor.Status.Failure(new UndefinedCoffeMachineException());
            //var msg =
            var serializer = new HyperionSerializer((ExtendedActorSystem)Sys);
            var bytes      = serializer.ToBinary(msg);
            var restored   = serializer.FromBinary(bytes, msg.GetType());

            Assert.NotNull(restored);
        }
示例#2
0
        public void Process_Faults_Should_be_deserializable()
        {
            //CoffeMakeFailedEvent
            var coffeMakeFailedEvent = new CoffeMakeFailedEvent(Guid.NewGuid().ToString(), Guid.NewGuid().ToString());

            CheckDeserialize(coffeMakeFailedEvent, nameof(coffeMakeFailedEvent));

            var undefinedCoffeMachineException = new UndefinedCoffeMachineException();

            CheckDeserialize(undefinedCoffeMachineException, nameof(undefinedCoffeMachineException));

            var processTransitionException = new ProcessTransitionException(coffeMakeFailedEvent, undefinedCoffeMachineException);

            CheckDeserialize(processTransitionException, nameof(processTransitionException));

            var eventExecutionException = new EventExecutionException("test", processTransitionException);

            CheckDeserialize(eventExecutionException, nameof(eventExecutionException));

            var msg = new Akka.Actor.Status.Failure(new AggregateException(eventExecutionException));

            CheckDeserialize(msg, nameof(msg));
        }