Exemplo n.º 1
0
        public CostExternalServicesTest()
        {
            var mockRepo = new AddressRepository(); // Deberia mockear al ser UT, si fuera integración no.

            this.costRepository      = new CostRepository(mockRepo);
            this.costExternalService = new CostExternalService(this.costRepository);
        }
Exemplo n.º 2
0
        public async Task ProcessCost(List <core.Cost> Costs)
        {
            using (var context = new JonasTest.Data.Model.ScoreCardContext())
            {
                var repository = new CostRepository(context);
                await repository.AddRange(Costs);

                await context.SaveChangesAsync();
            }
        }
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();
        }
Exemplo n.º 4
0
        public UserInterface()
        {
            InitializeComponent();
            ParkingContext context = new ParkingContext();
            ParkingRepository <Purchase> purchaseRepository =
                new PurchaseRepository(context);
            ParkingRepository <Account> accountRepository =
                new AccountRepository(context);
            ParkingRepository <BusinessLogic.Domain.CostPerMinute> costRepository =
                new CostRepository(context);

            MyParking = new Parking(purchaseRepository,
                                    accountRepository, costRepository);

            costPerMinute = new CostPerMinute(MyParking);
        }
Exemplo n.º 5
0
        private void UpdateCosts()
        {
            var costs = new CostRepository().GetAll();

            listView2.Items.Clear();

            foreach (Cost cost in costs)
            {
                var row = new string[]
                {
                    cost.Id.ToString(),
                          cost.CreateDate.ToString("dd.MM.yyy"),
                    cost.DateStart.ToString("dd.MM.yyy"),
                    cost.DateEnd.ToString("dd.MM.yyy"),
                    cost.CostValue.ToString()
                };
                var lv = new ListViewItem(row)
                {
                    Tag = cost
                };
                listView2.Items.Add(lv);
            }
        }
Exemplo n.º 6
0
 public ValuesController(DbEntity dbEntity, CostRepository costRepository)
 {
     _dbEntity       = dbEntity;
     _costRepository = costRepository;
 }
Exemplo n.º 7
0
 public void SetUpCostRepository()
 {
     costRepository = new CostRepository(new ParkingContext());
 }