public void Test_HighestAndLowestPerCurrency_ReturnsAListOfTwoElements_WhenGivenAListOfTwoElements() { List<Currency> distinctDoesNotLikeMockLists = new List<Currency>(); distinctDoesNotLikeMockLists.Add(new Mock<Currency>("EUR", 1, "12-12-2012").Object); distinctDoesNotLikeMockLists.Add(new Mock<Currency>("EUR", 0, "12-12-2012").Object); Comparison comparison = new Comparison(distinctDoesNotLikeMockLists); List<Currency> actual = comparison.HighestAndLowestPerCurrency(""); Assert.AreEqual(2, actual.Count); }
public void Test_HighestAndLowestPerCurrency_ReturnsAnEmptyList_WhenGivenAnEmptyList() { Comparison comparison = new Comparison(mockXML.Object); List<Currency> actual = comparison.HighestAndLowestPerCurrency(""); Assert.AreEqual(0, actual.Count); }
public void Test_HighestAndLowestPerCurrency_ReturnsAListOfTwoElements_WhenGivenAListOfFiveElementsFromTheSameSymbolForGBP() { Mock<Currency> a = new Mock<Currency>("EUR", 1, "12-12-2012"); Mock<Currency> b = new Mock<Currency>("EUR", 1, "13-12-2012"); Mock<Currency> c = new Mock<Currency>("EUR", 2, "14-12-2012"); Mock<Currency> d = new Mock<Currency>("EUR", 3, "15-12-2012"); Mock<Currency> e = new Mock<Currency>("EUR", 4, "16-12-2012"); Mock<Currency> f = new Mock<Currency>("GBP", 0.5, "12-12-2012"); Mock<Currency> g = new Mock<Currency>("GBP", 0.5, "13-12-2012"); Mock<Currency> h = new Mock<Currency>("GBP", 0.5, "14-12-2012"); Mock<Currency> i = new Mock<Currency>("GBP", 0.5, "15-12-2012"); Mock<Currency> j = new Mock<Currency>("GBP", 0.5, "16-12-2012"); List<Currency> distinctDoesNotLikeMockLists = new List<Currency>(); distinctDoesNotLikeMockLists.Add(a.Object); distinctDoesNotLikeMockLists.Add(b.Object); distinctDoesNotLikeMockLists.Add(c.Object); distinctDoesNotLikeMockLists.Add(d.Object); distinctDoesNotLikeMockLists.Add(e.Object); distinctDoesNotLikeMockLists.Add(f.Object); distinctDoesNotLikeMockLists.Add(g.Object); distinctDoesNotLikeMockLists.Add(h.Object); distinctDoesNotLikeMockLists.Add(i.Object); distinctDoesNotLikeMockLists.Add(j.Object); Comparison comparison = new Comparison(distinctDoesNotLikeMockLists); List<Currency> expected = new List<Currency>(); expected.Add(new Currency("EUR",2,"12-12-2012")); expected.Add(new Currency("EUR",8,"16-12-2012")); expected.Add(new Currency("GBP", 1, "12-12-2012")); expected.Add(new Currency("GBP", 1, "12-12-2012")); List<Currency> actual = comparison.HighestAndLowestPerCurrency("GBP"); Assert.IsTrue(actual.SequenceEqual(expected,new CurrencyComparerSymbolAndValue())); }