Beispiel #1
0
        public async Task GetAllFileDetailsAsync_GivenTwoFileDetailsExist_ShouldReturnTwoFileDetails()
        {
            //Arrange
            _fileDetailsRepository.GetAllFileDetailsAsync().Returns(a => _fileDetailsList);

            //Act
            var results = await _storageService.GetAllFileDetailsAsync();

            //Assert
            Assert.AreEqual(2, results.Count());
            Assert.IsTrue(results.Any(a => a.Id == _fileDetails.Id));
            Assert.IsTrue(results.Any(a => a.Name == _fileDetails.Name));
            Assert.IsTrue(results.Any(a => a.Description == _fileDetails.Description));
            Assert.IsTrue(results.Any(a => a.HashId == _fileDetails.HashId));
            Assert.IsTrue(results.Any(a => a.Size == _fileDetails.Size));
            Assert.IsTrue(results.Any(a => a.StorageId == _fileDetails.StorageId));

            Assert.IsTrue(results.Any(a => a.Id == _fileDetails2.Id));
            Assert.IsTrue(results.Any(a => a.Name == _fileDetails2.Name));
            Assert.IsTrue(results.Any(a => a.Description == _fileDetails2.Description));
            Assert.IsTrue(results.Any(a => a.HashId == _fileDetails2.HashId));
            Assert.IsTrue(results.Any(a => a.Size == _fileDetails2.Size));
            Assert.IsTrue(results.Any(a => a.StorageId == _fileDetails2.StorageId));
        }
Beispiel #2
0
 public async Task <IEnumerable <FileDetails> > GetAllFileDetailsAsync()
 {
     return(await _fileDetailsRepository.GetAllFileDetailsAsync());
 }