예제 #1
0
        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");
        }
예제 #2
0
 private void Apply(LevelRenamedEvent evt)
 {
     this.name = evt.NewName;
 }