Example #1
0
        public void GetNamesTest()
        {
            //Arrange
            string exampleNames = "{ 'NZD':'New Zealand Dollar', 'AUD':'Australian Dollar'}";
            string testName1    = "New Zealand Dollar";
            string testName2    = "Australian Dollar";

            //Act
            Names names = OpenExchangeRateApi.GetNames(exampleNames);

            //Assert
            Assert.AreEqual(names.NZD, testName1);
            Assert.AreEqual(names.AUD, testName2);
        }
Example #2
0
        public void GetRatesTest()
        {
            //Arrange
            string exampleRates = "{ 'NZD':'1', 'AUD':'0.85'}";
            string testRate1    = "1";
            string testRate2    = "0.85";

            //Act
            Names rates = OpenExchangeRateApi.GetNames(exampleRates);

            //Assert
            Assert.AreEqual(rates.NZD, testRate1);
            Assert.AreEqual(rates.AUD, testRate2);
        }