示例#1
0
 private void Apply(ModuleTypeCreated @event)
 {
     Id          = @event.AggregateRootId;
     AppId       = @event.AppId;
     Status      = @event.Status;
     Name        = @event.Name;
     Title       = @event.Title;
     Description = @event.Description;
     ViewType    = @event.ViewType;
     ViewName    = @event.ViewName;
     EditType    = @event.EditType;
     EditUrl     = @event.EditUrl;
 }
 public void Setup()
 {
     _command = new CreateModuleType
     {
         AppId       = Guid.Empty,
         Id          = Guid.NewGuid(),
         Name        = "Name",
         Title       = "Title",
         Description = "Description",
         ViewType    = ViewType.View,
         ViewName    = "ViewName",
         EditType    = EditType.Page,
         EditUrl     = "EditUrl"
     };
     _validatorMock = new Mock <IValidator <CreateModuleType> >();
     _validatorMock.Setup(x => x.Validate(_command)).Returns(new ValidationResult());
     _moduleType = ModuleType.CreateNew(_command, _validatorMock.Object);
     _event      = _moduleType.Events.OfType <ModuleTypeCreated>().SingleOrDefault();
 }