Ejemplo n.º 1
0
        private void Apply(TextModuleCreated @event)
        {
            Id       = @event.AggregateRootId;
            ModuleId = @event.ModuleId;
            Status   = @event.Status;

            TextVersions.Add(new TextVersion(@event.VersionId,
                                             @event.AggregateRootId,
                                             @event.Content,
                                             string.Empty,
                                             @event.VersionStatus,
                                             new List <TextLocalisation>()));
        }
Ejemplo n.º 2
0
 public void Setup()
 {
     _command = new CreateTextModule
     {
         SiteId   = Guid.NewGuid(),
         ModuleId = Guid.NewGuid(),
         Id       = Guid.NewGuid(),
         Content  = "Content"
     };
     _validatorMock = new Mock <IValidator <CreateTextModule> >();
     _validatorMock.Setup(x => x.Validate(_command)).Returns(new ValidationResult());
     _textModule = TextModule.CreateNew(_command, _validatorMock.Object);
     _event      = _textModule.Events.OfType <TextModuleCreated>().SingleOrDefault();
 }