Exemple #1
0
        public static void LoadTypes()
        {
            VoucherIssuedEvent v = new VoucherIssuedEvent(Guid.NewGuid(), Guid.NewGuid(), DateTime.Now, "", "");

            TransactionHasStartedEvent t = new TransactionHasStartedEvent(Guid.Parse("2AA2D43B-5E24-4327-8029-1135B20F35CE"), Guid.NewGuid(), Guid.NewGuid(),
                                                                          DateTime.Now, "", "", "", "", null);

            ReconciliationHasStartedEvent r =
                new ReconciliationHasStartedEvent(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), DateTime.Now);

            EstateCreatedEvent          e  = new EstateCreatedEvent(Guid.NewGuid(), "");
            MerchantCreatedEvent        m  = new MerchantCreatedEvent(Guid.NewGuid(), Guid.NewGuid(), "", DateTime.Now);
            ContractCreatedEvent        c  = new ContractCreatedEvent(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), "");
            MerchantBalanceChangedEvent mb =
                new MerchantBalanceChangedEvent(Guid.NewGuid(), Guid.NewGuid(), DateTime.Now, Guid.NewGuid(), Guid.NewGuid(), 0, 0, 0, "");
            ImportLogCreatedEvent i = new ImportLogCreatedEvent(Guid.NewGuid(), Guid.NewGuid(), DateTime.MinValue);
            FileCreatedEvent      f = new FileCreatedEvent(Guid.NewGuid(),
                                                           Guid.NewGuid(),
                                                           Guid.NewGuid(),
                                                           Guid.NewGuid(),
                                                           Guid.NewGuid(),
                                                           Guid.NewGuid(),
                                                           String.Empty,
                                                           DateTime.MinValue);
            SettlementCreatedForDateEvent s  = new SettlementCreatedForDateEvent(Guid.NewGuid(), Guid.NewGuid(), DateTime.Now);
            StatementCreatedEvent         ms = new StatementCreatedEvent(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), DateTime.Now);

            TypeProvider.LoadDomainEventsTypeDynamically();
        }
        public void SettlementDomainEventHandler_SettlementCreatedForDateEvent_EventIsHandled()
        {
            SettlementCreatedForDateEvent     domainEvent = TestData.SettlementCreatedForDateEvent;
            Mock <IEstateReportingRepository> estateReportingRepository = new Mock <IEstateReportingRepository>();

            SettlementDomainEventHandler eventHandler = new SettlementDomainEventHandler(estateReportingRepository.Object);

            Logger.Initialise(NullLogger.Instance);

            Should.NotThrow(async() => { await eventHandler.Handle(domainEvent, CancellationToken.None); });
        }
 private async Task HandleSpecificDomainEvent(SettlementCreatedForDateEvent domainEvent,
                                              CancellationToken cancellationToken)
 {
     await this.EstateReportingRepository.CreateSettlement(domainEvent, cancellationToken);
 }