public IEnumerable <User> GetFileUsers(Guid id) { try { return(_sharesRepository.GetFileUsers(id)); } catch (Exception ex) { Log.Logger.ServiceLog.Error(ex.Message); throw; } }
public void ShouldAddAndGetShares() { //arrange List <Share> shares = new List <Share>(); var share = new Share { FileId = TestFile.Id, UserId = TestUser.Id }; shares.Add(share); //act var newShare = _sharesRepository.Add(share); var result = _sharesRepository.GetFileUsers(TestFile.Id); //asserts foreach (var res in result) { Assert.AreEqual(res.Id, share.UserId); } _sharesRepository.Delete(newShare.id); }