public void UpdateCost(int newValue) { CostPerMinute newCost = GetActualCost(); newCost.Value = newValue; costRepository.Update(newCost); }
public CostPerMinute GetActualCost() { CostPerMinute a = costRepository.Get ("", ActualCountry.GetCountryTag()); return(a); }
public void CreateCostPerMinute() { CostPerMinute cost = new CostPerMinute { Value = 2, CountryTag = "UY" }; Assert.AreEqual(cost.Value, 2); Assert.AreEqual(cost.CountryTag, "UY"); }
public void UpdateCostPerMinuteValueInexistentCost() { CostPerMinute aCost = new CostPerMinute() { Value = 1, CountryTag = "UY" }; aCost.Value = 2; costRepository.Update(aCost); }
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)); }
public void UpdateCostPerMinuteValue() { CostPerMinute aCost = new CostPerMinute() { Value = 1, CountryTag = "UY" }; costRepository.Context.Costs.Add(aCost); costRepository.Context.SaveChanges(); aCost.Value = 2; costRepository.Update(aCost); Assert.AreEqual(costRepository.Get("", aCost.CountryTag).Value, 2); }
public void AddAlreadyExistentCostPerMinute() { CostPerMinute aCost = new CostPerMinute() { Value = 1, CountryTag = "UY" }; costRepository.Context.Costs.Add(aCost); costRepository.Context.SaveChanges(); CostPerMinute newCost = new CostPerMinute() { Value = 2, CountryTag = "UY" }; costRepository.Add(newCost); }
private void LoadInicialCost() { CostPerMinute inicialCostUy = new CostPerMinute() { Value = INICIAL_DEFAULT_COSTPERMINUTE, CountryTag = "UY" }; CostPerMinute inicialCostAr = new CostPerMinute() { Value = INICIAL_DEFAULT_COSTPERMINUTE, CountryTag = "AR" }; CostPerMinute a = GetActualCost(); if (a == null) { costRepository.Add(inicialCostUy); costRepository.Add(inicialCostAr); } }