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()); }
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()); }
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(); } }