Пример #1
0
        private static void SetUp()
        {
            lock (LockObject)
            {
                var log = NLog.LogManager.GetCurrentClassLogger();
                log.Trace("Setting up FakeDi");
                var sqlConStr = ConfigurationManager.ConnectionStrings["Notifications"].ConnectionString;


                pipleLineHook = new PipeLineHook();
                store         = new EventStoreFactory(pipleLineHook).GetStore();
                var toReadModellSubscriptionConsumer = new AddRemoveTokenToReadModellSubscriptionConsumer(sqlConStr);


                eventstoreSubscriptionFactory = new EventstoreSubscriptionFactory(store, pipleLineHook);
                eventstoreSubscriptionFactory.CreateSubscription(toReadModellSubscriptionConsumer);
                personExecutor       = new PersonExecutor(store, null);
                personCommandHandler = new PersonCommandHandler(personExecutor, null);

                personalNumberAndTokenReadModell = new PersonalNumberAndTokenReadModell(sqlConStr);

                var multiActiveTokenProhibiter = new MultiActiveTokenProhibiter(new SubscriptionConsumerCommiter(sqlConStr), personalNumberAndTokenReadModell, personCommandHandler);
                eventstoreSubscriptionFactory.CreateSubscription(multiActiveTokenProhibiter);

                isReady = true;
                log.Trace("FakeDI ready");
            }
        }
Пример #2
0
        public PersonCommandHandlerTests()
        {
            _fixture = new Fixture();
            _fixture.Behaviors.OfType <ThrowingRecursionBehavior>().ToList().ForEach(b => _fixture.Behaviors.Remove(b));
            _fixture.Behaviors.Add(new OmitOnRecursionBehavior());

            _personRepository = Substitute.For <IPersonRepository>();
            _sut = new PersonCommandHandler(_personRepository);
        }
Пример #3
0
 public MultiActiveTokenProhibiter(ISubscriptionConsumerCommiter commiter, IPersonalNumberAndTokenReadModell tokenReadModell, PersonCommandHandler commandHandler)
 {
     _commiter        = commiter;
     _tokenReadModell = tokenReadModell;
     _commandHandler  = commandHandler;
 }