Пример #1
0
 public IEnumerable <TEntity> GetAll()
 {
     try
     {
         return(TourDatabaseContext.Set <TEntity>());
     }
     catch (Exception ex)
     {
         throw new Exception($"Couldn't retrieve entities: {ex.Message}");
     }
 }
Пример #2
0
        public void GetAll_WhenExceptionOccurs_ThrowsException()
        {
            A.CallTo(() => _TourDatabaseContext.Set <Tour>()).Throws <Exception>();

            _testeeFake.Invoking(x => x.GetAll()).Should().Throw <Exception>().WithMessage("Couldn't retrieve entities: Exception of type 'System.Exception' was thrown.");
        }