public void CreateEventAdapterTest() { string aggregateId = "Box"; int aggregateVersion = 2; string aggregateType = typeof(Location).FullName; string commandId = Guid.NewGuid().ToString(); string correlationId = commandId; LocationCreated locationCreatedEvent = new LocationCreated(aggregateId, string.Empty); string jsonEvent = new EventSerialization().SerializeEvent(locationCreatedEvent); var eventAdapter = new EventSerialization().DeserializeEvent(aggregateId, aggregateVersion, aggregateType, commandId, correlationId, jsonEvent); Assert.IsInstanceOfType(eventAdapter, typeof(IEvent)); Assert.IsInstanceOfType(eventAdapter, typeof(IEvent <LocationCreated>)); }
public void DeserializedEventAdapterAsFulyTypedTest() { string aggregateId = "Box"; int aggregateVersion = 2; string aggregateType = typeof(Location).FullName; string commandId = Guid.NewGuid().ToString(); string correlationId = commandId; var locationCreated = new LocationCreated(aggregateId, string.Empty); string serializedLocationCreated = new EventSerialization().SerializeEvent(locationCreated); var eventAdapter = new EventSerialization().DeserializeEvent(aggregateId, aggregateVersion, aggregateType, commandId, correlationId, serializedLocationCreated); var fullyTypedEventAdapter = eventAdapter.AsFullyTypedEvent(eventAdapter.EventBody); Assert.IsInstanceOfType(fullyTypedEventAdapter, typeof(IEvent <LocationCreated>)); }
private void Handle(LocationCreated ievent) { NotifyAffected("LocationCreated", ievent.Location, ievent.Location.Lat, ievent.Location.Lng); }