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); }
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(); } }
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(); }
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); }
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); } }
public ValuesController(DbEntity dbEntity, CostRepository costRepository) { _dbEntity = dbEntity; _costRepository = costRepository; }
public void SetUpCostRepository() { costRepository = new CostRepository(new ParkingContext()); }