Example #1
0
        public void UpdateCost(int newValue)
        {
            CostPerMinute newCost = GetActualCost();

            newCost.Value = newValue;
            costRepository.Update(newCost);
        }
Example #2
0
        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");
        }
Example #4
0
        public void UpdateCostPerMinuteValueInexistentCost()
        {
            CostPerMinute aCost = new CostPerMinute()
            {
                Value      = 1,
                CountryTag = "UY"
            };

            aCost.Value = 2;

            costRepository.Update(aCost);
        }
Example #5
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));
        }
Example #6
0
        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);
        }
Example #7
0
        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);
        }
Example #8
0
        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);
            }
        }