예제 #1
0
        public void checkPort_II()
        {
            string[] getFileData = PortfolioStock.getStockFile(@"C:\Users\vinothkanth\Desktop\PortFolioData.txt");

            string[] getSingleLine = PortfolioStock.fetchSingleLine(getFileData);

            double[] getStockValue = PortfolioStock.splitFileData(getSingleLine);

            double[] stockValue = new double[] { 18500, 6000, 2000 };
            Assert.AreNotEqual(stockValue, getStockValue);
        }
예제 #2
0
        public void checkPortResult()
        {
            string[] getFileData = PortfolioStock.getStockFile(@"C:\Users\vinothkanth\Desktop\PortFolioData.txt");

            string[] getSingleLine = PortfolioStock.fetchSingleLine(getFileData);

            double[] getStockValue = PortfolioStock.splitFileData(getSingleLine);

            double[] stockValue = new double[3];
            stockValue[0] = 3000.0;
            stockValue[1] = 8000.0;
            stockValue[2] = 13500.0;
            CollectionAssert.AreEqual(stockValue, getStockValue);
        }
예제 #3
0
 public void AutoTellTest()
 {
     try
     {
         PortfolioStock.getStockFile(@"C:\Users\vinothkanth\Desktop\PortFolioData.txt");
     }
     catch (System.IO.FileNotFoundException e)
     {
         StringAssert.Contains(e.Message, "File Not Found Exception");
         return;
     }
     catch (Exception e)
     {
         StringAssert.Contains(e.Message, "File Not Found Exception");
         return;
     }
     Assert.Fail("No Exception was through");
 }
예제 #4
0
 public void UnknownFile()
 {
     string[] stockData = PortfolioStock.getStockFile(@"C:\Users\vinothkanth\Desktop\Por");
     string[] checkData = new string[] {};
     CollectionAssert.AreEqual(checkData, stockData);
 }
예제 #5
0
 public void FileNotEmpty()
 {
     string[] stockData = PortfolioStock.getStockFile(@"C:\Users\vinothkanth\Desktop\PortFolioData.txt");
     string[] checkData = new string[] { };
     CollectionAssert.AreNotEqual(checkData, stockData);
 }