Exemplo n.º 1
0
        public void FilterCurrency_NullGiven_ReturnsTrue()
        {
            //Arrange
            CurrencyService currencyService = new CurrencyService();

            var tcmbCurrency = TestCurrencyRepository.GetCurrencyRates();
            var currencyList = (from a in tcmbCurrency.Elements("Currency")
                                select a).ToList();

            //Act
            var result         = currencyService.FilterCurrency(currencyList, null, null);
            var expectedResult = currencyList;

            //Assert
            Assert.AreEqual(expectedResult, result);
        }
Exemplo n.º 2
0
        public void SortCurrency_NullGiven_ReturnsTrue()
        {
            //Arrange
            CurrencyService currencyService = new CurrencyService();

            var tcmbCurrency       = TestCurrencyRepository.GetCurrencyRates();
            var sortedCurrencyList = (from a in tcmbCurrency.Elements("Currency")
                                      select a).ToList();

            //Act
            var result         = currencyService.SortCurrency(tcmbCurrency, null, null);
            var expectedResult = sortedCurrencyList;

            //Assert
            for (int i = 0; i < result.Count(); i++)
            {
                Assert.AreEqual(expectedResult[i].ToString(), result[i].ToString());
            }
        }
Exemplo n.º 3
0
        public void FilterCurrency_KodFilterGiven_ReturnsFalse()
        {
            //Arrange
            CurrencyService currencyService = new CurrencyService();

            var tcmbCurrency = TestCurrencyRepository.GetCurrencyRates();
            var currencyList = (from a in tcmbCurrency.Elements("Currency")
                                select a).ToList();

            //Act
            var             result         = currencyService.FilterCurrency(currencyList, "Kod", "ttt");
            List <XElement> expectedResult = new List <XElement>();

            expectedResult.Add(TestCurrencyRepository.GetCodeFilteredCurrency());

            //Assert
            for (int i = 0; i < result.Count(); i++)
            {
                Assert.AreEqual(expectedResult[i].ToString(), result[i].ToString());
            }
        }