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); }
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); }
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(); }