Пример #1
0
        public void FindStockFileName()
        {
            IFileRepository repository = new FileStockRepository(repositoryDir);

            Assert.AreEqual("stock123.txt", repository.StockFileName(123));
            hp.Id = 456;
            Assert.AreEqual("stock456.txt", repository.StockFileName(hp));
        }
Пример #2
0
        public void CanSaveStockWritesToFile()
        {
            IFileRepository repository = new FileStockRepository(repositoryDir);

            repository.SaveStock(yhoo);
            Assert.IsFalse(yhoo.Id == 0);
            FileInfo fileYhoo = new FileInfo(repositoryDir + repository.StockFileName(yhoo));

            Assert.IsTrue(fileYhoo.Exists);
        }