Example #1
0
 private void Apply(ThemeCreated @event)
 {
     Name        = @event.Name;
     Description = @event.Description;
     Folder      = @event.Folder;
     SortOrder   = @event.SortOrder;
     Status      = @event.Status;
 }
Example #2
0
 public void Setup()
 {
     _command = new CreateTheme
     {
         Id          = Guid.NewGuid(),
         Name        = "Name",
         Description = "Description",
         Folder      = "Folder"
     };
     _validatorMock = new Mock <IValidator <CreateTheme> >();
     _validatorMock.Setup(x => x.Validate(_command)).Returns(new ValidationResult());
     _sortOrderGeneratorMock = new Mock <IThemeSortOrderGenerator>();
     _sortOrderGeneratorMock.Setup(x => x.GenerateNextSortOrder()).Returns(4);
     _theme = Theme.CreateNew(_command, _validatorMock.Object, _sortOrderGeneratorMock.Object);
     _event = _theme.Events.OfType <ThemeCreated>().SingleOrDefault();
 }