Ejemplo n.º 1
0
        public LogAddPage(LogAddViewModel viewModel)
        {
            InitializeComponent();

            this.viewModel = viewModel;
            BindingContext = this.viewModel;
        }
Ejemplo n.º 2
0
        public void ConstructorMustConstruct()
        {
            var f = new FoodPerDay();
            var r = new Mock <IFoodRepository>();
            var m = new LogAddViewModel(r.Object, f);

            Assert.IsNotNull(m);
            Assert.IsNotNull(m.Item);
            Assert.IsNotNull(m.SelectableFoods);
            Assert.IsNotNull(m.FoodRepository);
            Assert.IsNull(m.RecipeRepository);
            Assert.AreEqual(MealType.BreakFast, m.SelectedMealType.MealType);
        }
Ejemplo n.º 3
0
        public void Post([FromBody] LogAddViewModel logOp)
        {
            VendingOperation vendOp = new VendingOperation();

            vendOp.OperationType = (VendingOperation.eOperationType)logOp.OperationType;
            vendOp.Price         = logOp.Price;
            vendOp.TimeStamp     = logOp.TimeStamp;
            vendOp.UserId        = logOp.UserId;
            if (logOp.OperationType == LogAddViewModel.eOperationType.PurchaseItem)
            {
                vendOp.ProductId = logOp.ProductId;
            }

            _loggingDAO.LogOperation(vendOp);
        }