public void Can_log_Brand_Deactivated() { var @event = new BrandDeactivated(); _serviceBus.PublishMessage(@event); AssertAdminActivityLog(@event, AdminActivityLogCategory.Brand); }
public void Handle(BrandDeactivated deactivatedEvent) { 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 == deactivatedEvent.Id); if (record == null) { throw new RegoException(string.Format(BrandNotFoundMessage, deactivatedEvent.Id)); } record.BrandStatus = BrandStatus.Deactivated.ToString(); record.Deactivated = deactivatedEvent.EventCreated; record.DeactivatedBy = deactivatedEvent.EventCreatedBy; repository.SaveChanges(); }
public void Consume(BrandDeactivated message) { _eventHandlers.Handle(message); }
public void Handle(BrandDeactivated @event) { AddActivityLog(AdminActivityLogCategory.Brand, @event); }