public async Task GetRequestInfoByCodeNoData_Test() { var user = new Users { Id = 1, UserName = "******", FirstName = "A", MiddleName = "B", LastName = "C" }; _dbContext.Set <Users>().Add(user); var userBookRequests = new UserBookRequests { Id = 1, UserId = 1, RequestCode = "ABCD", RequestDate = DateTime.Now, User = user }; _dbContext.Set <UserBookRequests>().Add(userBookRequests); await _dbContext.SaveChangesAsync(); var efRepository = new EfRepository <UserBookRequests>(_dbContext); var getRequestInfoByCodeQuery = new GetRequestInfoByCodeQuery(efRepository); var result = await getRequestInfoByCodeQuery.ExecuteAsync("ABCDE"); Assert.Null(result); }
public async Task GetRequestInfoByCodeNull_Test() { var efRepository = new EfRepository <UserBookRequests>(_dbContext); var getRequestInfoByCodeQuery = new GetRequestInfoByCodeQuery(efRepository); var result = await getRequestInfoByCodeQuery.ExecuteAsync(null); Assert.Null(result); }