public void ShouldCreateNewStructure() { var structureId = new StructureId(); StructureCreatedEvent result = null; DomainEvents.Register((StructureCreatedEvent evt) => { result = evt; }); var structure = new Structure(structureId); structure.Id.Should().Be(structureId); result.Should().NotBeNull("domain method should raise event"); }
private void Apply(StructureCreatedEvent evt) { this.id = evt.EntityId; }