public void NullConstructor_Test() { InMemoryStockRepository repo = new InMemoryStockRepository(null); IEnumerable <IStock> result = repo.GetAllStocks(); Assert.IsNotNull(result); Assert.AreEqual(0, result.Count()); }
public void ValidConstructor_Test() { List <IStock> listOfStocks = new List <IStock>(); listOfStocks.Add(new Stock()); listOfStocks.Add(new Stock()); listOfStocks.Add(new Stock()); listOfStocks.Add(new Stock()); InMemoryStockRepository repo = new InMemoryStockRepository(listOfStocks); IEnumerable <IStock> result = repo.GetAllStocks(); Assert.IsNotNull(result); Assert.AreEqual(4, result.Count()); Assert.ReferenceEquals(result, listOfStocks); }