コード例 #1
0
        public void Initialize()
        {
            this.logger        = new Mock <ILogger>();
            this.domainFactory = new Mock <IDomainFactory>();
            this.migrator      = new Mock <IChangeEventMigrator>();
            this.repository    = new Mock <IRepository>();
            this.storage       =
                new GeneralEventStreamStorage <TestAggregateRoot>(this.logger.Object, this.domainFactory.Object,
                                                                  this.migrator.Object, this.repository.Object);

            this.stateChangedEvent = null;
            this.storage.OnEventStreamStateChanged += (sender, args) => { this.stateChangedEvent = args; };
        }
コード例 #2
0
        public GeneralEventStreamStorageSpec()
        {
            var recorder = new Mock <IRecorder>();

            this.domainFactory = new Mock <IDomainFactory>();
            var migrator = new Mock <IChangeEventMigrator>();

            this.repository = new Mock <IRepository>();
            this.storage    =
                new GeneralEventStreamStorage <TestAggregateRoot>(recorder.Object, this.domainFactory.Object,
                                                                  migrator.Object, this.repository.Object);

            this.stateChangedEvent = null;
            this.storage.OnEventStreamStateChanged += (sender, args) => { this.stateChangedEvent = args; };
        }