public void Setup()
 {
     _backendConnection = Substitute.For <IBackendConnection>();
     _findItemViewModel = Substitute.For <IFindItemViewModel>();
     _uut = new ShoppingListViewModel(_backendConnection, _findItemViewModel);
     _obj = new object();
 }
 public void Setup()
 {
     _cameraViewModel   = Substitute.For <ICameraViewModel>();
     _backendConnection = Substitute.For <IBackendConnection>();
     _uut = new AddItemViewModel(_cameraViewModel, _backendConnection);
     _obj = new object();
 }
示例#3
0
 public AddItemViewModel(ICameraViewModel cameraViewModel, IBackendConnection backendConnection)
 {
     _backendConnection = backendConnection;
     _inventoryItem     = new InventoryItem();
     CameraViewModel    = cameraViewModel;
     CameraViewModel.BarcodeFoundEventToViewModels += BarcodeAction;
 }
示例#4
0
 public AddItemViewModel()
 {
     _backendConnection = new BackendConnection();
     _inventoryItem     = new InventoryItem();
     CameraViewModel    = new CameraViewModel();
     CameraViewModel.BarcodeFoundEventToViewModels += BarcodeAction;
 }
 public ShoppingListViewModel(IBackendConnection backendConnection, IFindItemViewModel findItemViewModel)
 {
     _backendConnection = backendConnection;
     FindItemViewModel  = findItemViewModel;
     _currentItem       = new InventoryItem();
     InventoryItems     = new ObservableCollection <InventoryItem>();
     GetShoppingList();
 }
 public ShoppingListViewModel()
 {
     _backendConnection = new BackendConnection();
     FindItemViewModel  = new FindItemViewModel();
     _currentItem       = new InventoryItem();
     InventoryItems     = new ObservableCollection <InventoryItem>();
     GetShoppingList();
 }
        public FindItemViewModel(IBackendConnection backendConnection, ICameraViewModel cameraViewModel)
        {
            Items = new ObservableCollection <Item>();


            _backendConnection = backendConnection;
            CameraViewModel    = cameraViewModel;
            GetInventoryForFindItem();
        }
示例#8
0
 public RemoveItemViewModel()
 {
     CameraViewModel    = new CameraViewModel();
     _backendConnection = new BackendConnection();
     _inventoryItem     = new InventoryItem();
     CameraViewModel.BarcodeFoundEventToViewModels += BarcodeAction;
     _currentItem        = new InventoryItem();
     _inventoryItemsList = new ObservableCollection <InventoryItem>();
 }
示例#9
0
 public RemoveItemViewModel(ICameraViewModel cameraViewModel, IBackendConnection backendConnection, int originalQuantity)
 {
     CameraViewModel     = cameraViewModel;
     _backendConnection  = backendConnection;
     _inventoryItem      = new InventoryItem();
     _inventoryItemsList = new ObservableCollection <InventoryItem>();
     _currentItem        = new InventoryItem();
     CameraViewModel.BarcodeFoundEventToViewModels += BarcodeAction;
     OriginalQuantity = originalQuantity;
 }
        public FindItemViewModel()
        {
            Items = new ObservableCollection <Item>();


            _backendConnection = new BackendConnection();

            GetInventoryForFindItem();

            //Camera
            CameraViewModel = new 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);
            _cameraViewModel       = new CameraViewModel(_camConnection, _soundPlayer);
            _fakeBackendConnection = Substitute.For <IBackendConnection>();
            _findItemViewModel     = new FindItemViewModel(_fakeBackendConnection, _cameraViewModel);
            _obj = new object();

            _sut = new ShoppingListViewModel(_fakeBackendConnection, _findItemViewModel);
        }
        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);
            _cameraViewModel       = new CameraViewModel(_camConnection, _soundPlayer);
            _fakeBackendConnection = Substitute.For <IBackendConnection>();
            _obj = new object();

            myBitmap = new Bitmap(Environment.CurrentDirectory + @"\barcode.png");
            myBitmap.Save("myBitmap.bmp", System.Drawing.Imaging.ImageFormat.Bmp);

            _sut = new RemoveItemViewModel(_cameraViewModel, _fakeBackendConnection, 5);
        }
        public void Setup()
        {
            _backendConnection = Substitute.For <IBackendConnection>();

            ObservableCollection <InventoryItem> list = new ObservableCollection <InventoryItem>();

            InventoryItem inventoryItem1 = new InventoryItem();

            inventoryItem1.InventoryType = 1;

            InventoryItem inventoryItem2 = new InventoryItem();

            inventoryItem2.InventoryType = 2;

            list.Add(inventoryItem1);
            list.Add(inventoryItem2);

            _backendConnection.GetInventory().Returns(list);
            _sut = new ViewInventoriesViewModel(_backendConnection);
        }
示例#15
0
        public ViewInventoriesViewModel()
        {
            CMBBX             = new ObservableCollection <string>();
            AllInventoryItems = new ObservableCollection <InventoryItem>();
            AllItems          = new ObservableCollection <Item>();
            FridgeItems       = new ObservableCollection <Item>();
            FreezerItems      = new ObservableCollection <Item>();
            PantryItems       = new ObservableCollection <Item>();
            ShoppingListItems = new ObservableCollection <Item>();
            BackendConn       = new BackendConnection();

            CMBBX.Add("Alle varer");
            CMBBX.Add("Køleskab");
            CMBBX.Add("Fryser");
            CMBBX.Add("Spisekammer (øvrige)");
            CMBBX.Add("Indkøbsliste");
            CMBBX.Add("Ukendt");

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