public CommandsGateway( ICommandHandlerResolver commandHandlerResolver, Func <IDisposable> scopeFactory, IValidatorResolver validatorResolver) { _commandHandlerResolver = commandHandlerResolver; _scopeFactory = scopeFactory; _validationFacade = new ValidationFacade(validatorResolver); }
public void SetUp() { this.mocks = new MockRepository(); this.clientDao = mocks.Stub <IClientDao>(); this.mapper = mocks.Stub <IMapper>(); this.validator = mocks.Stub <IValidationFacade>(); this.transaction = mocks.Stub <ITransaction>(); this.target = new ClientService(); this.target.Mapper = this.mapper; this.target.Validator = this.validator; this.target.ClientDao = this.clientDao; this.failures = mocks.Stub <IFailureList>(); }
public AppGateway() { var userRepository = new UserRepository(); _validationFacade = new ValidationFacade(userRepository); _commandHandlers = new Dictionary <object, object> { [typeof(CreateUserCommand)] = new CreateUserCommandHandler(userRepository), [typeof(UpdateUserCommand)] = new UpdateUserCommandHandler(userRepository), [typeof(RunTaskCommand)] = new RunTaskCommandHandler() }; _queryHandlers = new Dictionary <object, object> { [typeof(UsersQuery)] = new UsersQueryHandler(userRepository) }; }