public void Setup() { _fakeVideoSource = Substitute.For <IVideoSource>(); _timer = new TimerClock(100); _barcodeReader = new ReadBarcode(); _fakeOutput = Substitute.For <IOutput>(); _camConnection = new CameraConnection(_timer, _barcodeReader, _fakeVideoSource, _fakeOutput); _soundPlayer = new SoundPlayer(_fakeOutput); _cameraViewModel = new CameraViewModel(_camConnection, _soundPlayer); _fakeBackendConnection = Substitute.For <IBackendConnection>(); ObservableCollection <Item> itemList = new ObservableCollection <Item>(); _item = new Item("Jordbær", "123", 7, 1); itemList.Add(_item); _fakeBackendConnection.GetListOfItems().Returns(itemList); _findItemViewModel = new FindItemViewModel(_fakeBackendConnection, _cameraViewModel); _sut = new ScanEANViewModel(_findItemViewModel, _fakeOutput, _cameraViewModel); }
public ScanEANWindow(FindItemViewModel ELA1) { ENO1 = new ScanEANViewModel(ELA1); InitializeComponent(); WindowStartupLocation = WindowStartupLocation.CenterScreen; }