Exemple #1
0
        public void CanWriteStockYahoo()
        {
            StockIO      io = new StockIO();
            StringWriter sw = new StringWriter();

            io.WriteStock(sw, yhoo);
            Assert.AreEqual("YHOO" + NL + "57.2" + NL + "30" + NL, sw.ToString());
        }
Exemple #2
0
        public void CanWriteToWriterHp()
        {
            StockIO      io = new StockIO();
            StringWriter sw = new StringWriter();

            io.WriteStock(sw, hp);
            Assert.AreEqual("HP" + NL + "11.4" + NL + "10" + NL, sw.ToString());
        }
Exemple #3
0
        public void CanWriteToFile()
        {
            FileInfo output = new FileInfo("stockout.txt");

            try
            {
                StockIO io = new StockIO();
                io.WriteStock(output, hp);
                Assert.IsTrue(output.Exists);
                Stock loaded = io.ReadStock(output);
                Assert.AreEqual(hp, loaded);
            }
            finally
            {
                output.Delete();
            }
        }