public void ShouldRetrieveAllPictures() { var mockStorage = new Mock<IStorageContext>(); mockStorage.Setup(s => s.Query<Picture>(StorageAccountConfiguration.PicturesTable)).Returns(() => { var result = new List<Picture>(); result.Add(new Picture()); result.Add(new Picture()); return result.AsQueryable(); }); var repository = new PictureRepository(mockStorage.Object); var pictures = repository.GetAll(); Assert.AreEqual(pictures.Count(), 2); }