Esempio n. 1
0
        public void TestHeadersInvalid()
        {
            Dictionary <MarketRateCsvParser.MarketDataFields, int> fieldMapping;
            MarketRateCsvParser parser = new MarketRateCsvParser();

            string data = "Lender,Available";

            fieldMapping = parser.ParseHeader(data);
        }
Esempio n. 2
0
        public void TestHeadersValid()
        {
            Dictionary <MarketRateCsvParser.MarketDataFields, int> fieldMapping;
            MarketRateCsvParser parser = new MarketRateCsvParser();

            string data = "Lender,Rate,Available";

            fieldMapping = parser.ParseHeader(data);
            Assert.AreEqual(2, fieldMapping[MarketRateCsvParser.MarketDataFields.Available], "Available check failed");
            Assert.AreEqual(1, fieldMapping[MarketRateCsvParser.MarketDataFields.Rate], "Rate check failed");
            Assert.AreEqual(0, fieldMapping[MarketRateCsvParser.MarketDataFields.Lender], "Lender check failed");

            data         = "Available,Lender,Rate";
            fieldMapping = parser.ParseHeader(data);
            Assert.AreEqual(0, fieldMapping[MarketRateCsvParser.MarketDataFields.Available], "Available check failed");
            Assert.AreEqual(2, fieldMapping[MarketRateCsvParser.MarketDataFields.Rate], "Rate check failed");
            Assert.AreEqual(1, fieldMapping[MarketRateCsvParser.MarketDataFields.Lender], "Lender check failed");

            data         = "Rate,Lender,Available";
            fieldMapping = parser.ParseHeader(data);
            Assert.AreEqual(2, fieldMapping[MarketRateCsvParser.MarketDataFields.Available], "Available check failed");
            Assert.AreEqual(0, fieldMapping[MarketRateCsvParser.MarketDataFields.Rate], "Rate check failed");
            Assert.AreEqual(1, fieldMapping[MarketRateCsvParser.MarketDataFields.Lender], "Lender check failed");
        }