public void Test_StrongThan_ReturnsAnListOfZeroElements_WhenGivenAListOfOneElementWithAnEmptyString() { mockXML.Object.Add(new Mock<Currency>("EUR", 1, "12-12-2012").Object); Comparison comparison = new Comparison(mockXML.Object); List<Currency> actual = comparison.StrongerThan(""); Assert.AreEqual(0, actual.Count); }
public void Test_StrongThan_ReturnsAListOfTwoElements_WhenGivenAListOfThreeElementsAndComparingToGBPRate() { Mock<Currency> a = new Mock<Currency>("EUR", 1, "12-12-2012"); Mock<Currency> b = new Mock<Currency>("GBP", 0.5, "12-12-2012"); Mock<Currency> c = new Mock<Currency>("USD", 3, "12-12-2012"); mockXML.Object.Add(a.Object); mockXML.Object.Add(b.Object); mockXML.Object.Add(c.Object); Comparison comparison = new Comparison(mockXML.Object); List<Currency> expected = new List<Currency>(); expected.Add(new Currency("EUR",2,"12-12-2012")); expected.Add(new Currency("USD",6,"12-12-2012")); List<Currency> actual = comparison.StrongerThan("GBP"); Assert.IsTrue(actual.SequenceEqual(expected,new CurrencyComparerSymbolAndValue())); }
public void Test_StrongThan_ReturnsAnEmptyList_WhenGivenAnEmptyList() { Comparison comparison = new Comparison(mockXML.Object); List<Currency> actual = comparison.StrongerThan(""); Assert.AreEqual(0, actual.Count); }
public void Test_StrongThan_ReturnsAListOfOneElements_WhenGivenAListOfThreeElementsAndEmptyString() { Mock<Currency> a = new Mock<Currency>("EUR", 1, "12-12-2012"); Mock<Currency> b = new Mock<Currency>("GBP", 0.5, "12-12-2012"); Mock<Currency> c = new Mock<Currency>("USD", 3, "12-12-2012"); mockXML.Object.Add(a.Object); mockXML.Object.Add(b.Object); mockXML.Object.Add(c.Object); Comparison comparison = new Comparison(mockXML.Object); List<Currency> expected = new List<Currency>(); expected.Add(c.Object); List<Currency> actual = comparison.StrongerThan(""); Assert.IsTrue(actual.SequenceEqual(expected)); }