Esempio n. 1
0
        public void ShouldReturnArraySortedByYearlyCostWhenTwoArraysAreCompared()
        {
            var tariffComparer = new TariffComparer();

            tariffComparer.Add(TariffType.BasiElectricity);
            tariffComparer.Add(TariffType.Packaged);

            var tariffs = tariffComparer.Compare(1);

            Assert.IsTrue(tariffs[0].YearlyCost < tariffs[1].YearlyCost);
        }
Esempio n. 2
0
        public void ShouldReturnTwoTariffsWhenTwoTariffsAreCompared()
        {
            var tariffComparer = new TariffComparer();

            tariffComparer.Add(TariffType.BasiElectricity);
            tariffComparer.Add(TariffType.Packaged);

            var tariffs = tariffComparer.Compare(1);

            Assert.AreEqual(tariffs.Count, 2);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var consumptions    = new decimal[] { 100, 4000, 5000, 6000, 123123, 255.255m };
            var tariffDisplayer = new TariffComparisonDisplayer();

            var tariffComparer = new TariffComparer();

            tariffComparer.Add(TariffType.BasiElectricity);
            tariffComparer.Add(TariffType.Packaged);

            foreach (var consumption in consumptions)
            {
                var tariffs = tariffComparer.Compare(consumption);
                tariffDisplayer.DisplayComparison(consumption, tariffs);
            }

            Console.ReadKey();
        }