public void New_NetworkDevice_Has_Created_Event_Uncommitted() { Guid deviceId = Guid.NewGuid(); string hostname = "SESM-001"; NetworkDevice device = new NetworkDevice(deviceId, hostname); var events = device.UncommittedEvents(); var expectedEvent = new NetworkDeviceCreated(deviceId, hostname); var actualEvent = events.First() as NetworkDeviceCreated; Assert.AreEqual(expectedEvent.DeviceId, actualEvent.DeviceId); Assert.AreEqual(expectedEvent.Hostname, actualEvent.Hostname); }
public void Apply(NetworkDeviceCreated @event) { _AggregateId = @event.DeviceId; hostname = @event.Hostname; }