Exemple #1
0
 public void Initialize()
 {
     this.provider  = Substitute.For <IPhraseProvider>();
     this.shareRep  = Substitute.For <IShareRepository>();
     this.traderRep = Substitute.For <ITraderRepository>();
     this.logger    = Substitute.For <ILoggerService>();
 }
Exemple #2
0
 public BrokerController(ITraderRepository traderRepository, ISecurityRepository securityRepository,
                         ITradeRepository tradeRepository)
 {
     _traderRepository   = traderRepository;
     _securityRepository = securityRepository;
     _tradeRepository    = tradeRepository;
 }
 public TraderService(
     IPhraseProvider provider,
     ITraderRepository traderRep,
     ILoggerService logger)
 {
     this.provider  = provider;
     this.traderRep = traderRep;
     this.logger    = logger;
 }
Exemple #4
0
 public TransactionService(
     ITraderRepository traderRep,
     IShareRepository shareRep,
     ITransactionRepository transactionRep,
     ILoggerService logger)
 {
     this.traderRep      = traderRep;
     this.shareRep       = shareRep;
     this.logger         = logger;
     this.transactionRep = transactionRep;
 }
Exemple #5
0
 public IncentiveAssignmentService(
     ITraderRepository traderRepository,
     IIncentiveDefinitionRepository incentiveDefinitionRepository,
     IIncentiveValueCalculator incentiveValueCalculator,
     IIncentiveRepository incentiveRepository
     )
 {
     _traderRepository = traderRepository;
     _incentiveDefinitionRepository = incentiveDefinitionRepository;
     _incentiveValueCalculator      = incentiveValueCalculator;
     _incentiveRepository           = incentiveRepository;
 }
Exemple #6
0
        public Controller(
            IInputOutput io,
            IPhraseProvider phraseProvider,
            GameSettings gs,
            ITraderService traderService,
            IShareService shareService,
            ITransactionService transactionService,
            ITraderRepository traderRep,
            IShareRepository shareRep,
            ITransactionRepository transactionRep)
        {
            this.io             = io;
            this.phraseProvider = phraseProvider;

            this.traderService      = traderService;
            this.shareService       = shareService;
            this.transactionService = transactionService;

            this.traderRep      = traderRep;
            this.shareRep       = shareRep;
            this.transactionRep = transactionRep;

            Point start  = (0, 0);
            int   whidth = gs.whidthWindow;
            int   height = gs.heightWindow;

            if (whidth < 160)
            {
                io.Print("Window whidth is low" + Environment.NewLine);
                throw new Exception();
            }
            if (height < 30)
            {
                io.Print("Window height is low" + Environment.NewLine);
                throw new Exception();
            }

            this.io.SetWindowSize(whidth + 4, height);
            terminal = new Terminal(
                (whidth / 2 + 1, start.y),
                whidth / 2,
                5,
                io,
                phraseProvider);

            menu = new Menu(
                start,
                whidth / 2,
                height,
                io,
                phraseProvider);
        }
        public void Initialize()
        {
            this.traderRep = Substitute.For <ITraderRepository>();
            this.traderRep.GetTrader(Arg.Any <int>()).Returns((callInfo) =>
            {
                var TraderId = callInfo.Arg <int>();
                return(traders.Where(t => t.Id == TraderId).SingleOrDefault());
            });

            this.shareRep = Substitute.For <IShareRepository>();
            this.shareRep.GetShare(Arg.Any <int>(), Arg.Any <string>()).Returns((callInfo) =>
            {
                var TraderId  = callInfo.Arg <int>();
                var shareName = callInfo.Arg <string>();

                return(shares.Where(t => t.name == shareName && t.ownerId == TraderId).SingleOrDefault());
            });

            this.transactionRep = Substitute.For <ITransactionRepository>();
            this.logger         = Substitute.For <ILoggerService>();
        }
Exemple #8
0
 public OrderStockCommandHandler(IStockRepository repository, ITraderRepository traderRepository)
 {
     _repository       = repository;
     _traderRepository = traderRepository;
 }
Exemple #9
0
 public TraderController(ITraderRepository traderRepository)
 {
     TraderRepository = traderRepository;
 }
Exemple #10
0
 public SimpleLogicTradeAnalyser(ITraderRepository traderRepo, IAstralSystemRepository systemRepo)
 {
     this.traderRepo = traderRepo;
     this.systemRepo = systemRepo;
 }
Exemple #11
0
 public TradersRepoController(ITraderRepository context)
 {
     _context = context;
 }
 public TraderRepoController(ITraderRepository _repo)
 {
     TradersRepo = _repo;
 }
 public MetaTraderController(IMapper mapper, ITraderRepository repo, ICalculate calc)
 {
     _mapper = mapper;
     _repo   = repo;
     _calc   = calc;
 }
 public NewTradeOfferCommand(ITraderRepository traderRepo)
 {
     this.traderRepo = traderRepo;
 }
Exemple #15
0
 public Calculate(ITraderRepository repo)
 {
     _repo = repo;
 }
Exemple #16
0
 public GetTraderByIdQueryHandler(ITraderRepository traderRepository)
 {
     _traderRepository = traderRepository;
 }