What steps will reproduce the problem?
var context = Mocks.CreateQuery<ControllerContext>().Where(c =>
c.HttpContext.User.IsInRole("admin")).First();
What is the expected output? What do you see instead?
Expect that no exception is thrown.
Actual Output:
System.NullReferenceException: Object reference not set to an instance of an
object.
at lambda_method(ExecutionScope , ControllerContext )
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at System.Linq.Enumerable.First<TSource>(IEnumerable`1 source)
at lambda_method(ExecutionScope )
at System.Linq.EnumerableExecutor`1.Execute()
at
System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute<S>(Expression
expression)
at System.Linq.Queryable.First<TSource>(IQueryable`1 source)
at lambda_method(ExecutionScope )
What version of the product are you using?
trunk, SVN revision 634
Please provide any additional information below.
The following explicit expression works as expected:
var context = Mocks.CreateQuery<ControllerContext>().Where(c =>
c.HttpContext.User.IsInRole("admin") == true).First();
Original issue reported on code.google.com by michael....@gmail.com on 4 Sep 2009 at 12:54
Original issue reported on code.google.com by
michael....@gmail.com
on 4 Sep 2009 at 12:54