コード例 #1
0
 public async Task <Tuple <int, List <Captain> > > SearchCaptainAsync(Pagination pagination, Ordering ordering, IFilter <Captain> filter)
 {
     try
     {
         return(await m_repository.SearchAsync(pagination, ordering, filter));
     }
     catch (Exception e)
     {
         m_logger.LogCritical(e, "Unexpected Exception while trying to search for Captains");
         throw;
     }
 }
コード例 #2
0
        public async void SimpleSearch_Ok()
        {
            //ACT
            var(count, captains) = await m_repository.SearchAsync(new Pagination(), new Ordering(), new CaptainFilter());

            //ASSERT
            Assert.Equal(2, count);
            Assert.Equal(DatabaseSeed.Captain1Id, captains.First(t => t.Id.Equals(DatabaseSeed.Captain1Id)).Id);
            Assert.Equal(DatabaseSeed.Captain2Id, captains.First(t => t.Id.Equals(DatabaseSeed.Captain2Id)).Id);
        }