Exemplo n.º 1
0
        public void should_serialize_and_deserialize_event_message()
        {
            var changedNameEvent = new ChangedNameEvent("John Snow");
            var serializer = new JsonPayloadSerializer();

            var serializedPayload = serializer.Serialize(changedNameEvent);

            var deserializedPayload = serializer.Deserialize<ChangedNameEvent>(serializedPayload);

            deserializedPayload.Name.Should().Be(changedNameEvent.Name);
        }
Exemplo n.º 2
0
 private void Apply(ChangedNameEvent @event)
 {
     this.Name = @event.Name;
 }