Exemplo n.º 1
0
        public void Can_log_Brand_Activated()
        {
            var @event = new BrandActivated();

            _serviceBus.PublishMessage(@event);
            AssertAdminActivityLog(@event, AdminActivityLogCategory.Brand);
        }
Exemplo n.º 2
0
        public void Handle(BrandActivated activatedEvent)
        {
            var repository = _container.Resolve <IReportRepository>();

            //todo: refactor the following, updatedEvent.Id should not be the same as BrandId
            var record = repository.BrandRecords.SingleOrDefault(r => r.BrandId == activatedEvent.Id);

            if (record == null)
            {
                throw new RegoException(string.Format(BrandNotFoundMessage, activatedEvent.Id));
            }

            record.BrandStatus = BrandStatus.Active.ToString();
            record.Activated   = activatedEvent.EventCreated;
            record.ActivatedBy = activatedEvent.EventCreatedBy;
            repository.SaveChanges();
        }
Exemplo n.º 3
0
 public void Consume(BrandActivated message)
 {
     _eventHandlers.Handle(message);
 }
Exemplo n.º 4
0
 public void Handle(BrandActivated @event)
 {
     AddActivityLog(AdminActivityLogCategory.Brand, @event);
 }