Пример #1
0
        public async Task <Response <Lookup> > FindByIdAsync(int id)
        {
            var payload = await _lookupRepository.FindByIdAsync(id);

            return(payload == null ?
                   new Response <Lookup>("Search engine not found.") :
                   new Response <Lookup>(payload));
        }
Пример #2
0
        public async Task FindByIdAsyncTest()
        {
            // Arrange
            _appDbContext.Lookups.AddRange(MockDatabase.SearchEngines);

            // Act
            var response = await _lookupRepository.FindByIdAsync(1);

            // Assert
            Assert.AreEqual(1, response.Id);
            Assert.AreEqual("GOOGLE", response.Name.ToUpper());
        }