Exemplo n.º 1
0
        public void AddNewCostPerMinute()
        {
            CostPerMinute aCost = new CostPerMinute()
            {
                Value      = 1,
                CountryTag = "UY"
            };

            costRepository.Add(aCost);

            Assert.AreEqual(costRepository.Context.Costs.ToList().Count(), 1);
            Assert.IsTrue(costRepository.Context.Costs.ToList().Contains(aCost));
        }
Exemplo n.º 2
0
        public async Task <CostViewModel> Post(CostViewModel viewModel)
        {
            var data = new Cost
            {
                StatementDate = viewModel.StatementDate,
                Amount        = viewModel.Amount,
                CategoryId    = viewModel.CategoryId,
                UserId        = viewModel.UserId
            };
            var result = await _costRepository.Add(data);

            return(Transform(result));
        }
Exemplo n.º 3
0
        private void Button1_Click(object sender, EventArgs e)
        {
            Cost cost = new Cost
            {
                CostValue  = float.Parse(textBox1.Text),
                DateStart  = dateTimePicker1.Value,
                DateEnd    = dateTimePicker2.Value,
                CreateDate = DateTime.Now
            };
            CostRepository costs = new CostRepository();

            costs.Add(cost);
            this.Close();
        }