Ejemplo n.º 1
0
        public void TestInit()
        {
            _repository.Init(5000);

            Assert.AreEqual(5000, _repository.GetInstruments().Count(instrument => instrument.Type == InstrumentType.Bond));
            Assert.AreEqual(5000, _repository.GetInstruments().Count(instrument => instrument.Type == InstrumentType.Forex));
        }
Ejemplo n.º 2
0
        public TrainingForm()
        {
            InitializeComponent();
            _instrumentRepository = new MyInstrumentRepository();
            _instrumentRepository.Init(20);

            _pricer = new Pricer(_instrumentRepository, 1);

            _instruments =
                new ObservableCollection <InstrumentViewModel>(
                    _instrumentRepository.GetInstruments().Select(instrument => new InstrumentViewModel(instrument)));
        }
Ejemplo n.º 3
0
        public ViewModel()
        {
            _instrumentRepository = new MyInstrumentRepository();
            _instrumentRepository.Init(50);
            Instruments =
                new ObservableCollection <InstrumentViewModel>(
                    _instrumentRepository.GetInstruments().Select(instrument => new InstrumentViewModel(instrument)));
            _pricer = new Pricer(_instrumentRepository, 1);

            StartCommand   = new RelayCommand(o => { _pricer.Price(); }, o => true);
            StopCommand    = new RelayCommand(o => { _pricer.StopPrice(); }, o => true);
            RestartCommand = new RelayCommand(o => { _pricer.Restart(); }, o => true);
        }