private void Apply(ThemeCreated @event) { Name = @event.Name; Description = @event.Description; Folder = @event.Folder; SortOrder = @event.SortOrder; Status = @event.Status; }
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(); }