private async void GetInventoryForFindItem() { Items = await _backendConnection.GetListOfItems(); ViewFilter = (CollectionView)CollectionViewSource.GetDefaultView(Items); ViewFilter.Filter = UserFilter; }
public void Setup() { _cameraViewModel = Substitute.For <ICameraViewModel>(); _backendConnection = Substitute.For <IBackendConnection>(); ObservableCollection <Item> list = new ObservableCollection <Item>(); Item item = new Item(); item.Name = "mælk"; item.Ean = "123"; list.Add(item); _backendConnection.GetListOfItems().Returns(list); _uut = new FindItemViewModel(_backendConnection, _cameraViewModel); }
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); _obj = new object(); _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); _sut = new FindItemViewModel(_fakeBackendConnection, _cameraViewModel); }