I am trying to test async method but i am getting null reference exception.
I have a service that has a GetAll method which is async: public async Task<IQueryable<T>> GetAll()
and the method under test is calling this method: await _service.GetAll();
I am mocking the service and then doing an arrange on the getAll method, but i get a null reference exception when the method is called in the code under test.
Mock.Arrange(() => mockService.GetAll()).Returns(Task.FromResult<IQueryable<Models.VM>>(vms.AsQueryable()));