public void GivenAnAggregateThenAnInstanceIsCreated() { var aggregate = new SerializableAggregateRoot(); var @event = new AggregateSavingAsyncEventArgs <SerializableAggregateRoot>(aggregate); Assert.Equal(aggregate, @event.Aggregate); Assert.Same(aggregate, @event.Aggregate); }
public void GivenAnInstanceThenAllPropertiesAreSerialized() { var aggregate = new SerializableAggregateRoot(); var @event = new AggregateSavingAsyncEventArgs <SerializableAggregateRoot>(aggregate); AggregateSavingAsyncEventArgs <SerializableAggregateRoot> deserialized = @event.Clone(); Assert.Equal(@event.Aggregate, deserialized.Aggregate); Assert.NotSame(@event.Aggregate, deserialized.Aggregate); Assert.NotSame(@event, deserialized); }