public void RenameLevel() { LevelRenamedEvent result = null; DomainEvents.Register((LevelRenamedEvent evt) => { result = evt; }); var level = new Level(new LevelId(), new StructureId(), "Old Name"); level.Rename("New Name"); level.Name.Should().Be("New Name"); result.Should().NotBeNull("domain method should raise event"); }
private void Apply(LevelRenamedEvent evt) { this.name = evt.NewName; }