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)); }
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))); }
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); }