Skip to content

Problem accessing Linq methods (extension methods of IQueryable) inside isolated code #54

@wfrohmberg

Description

@wfrohmberg

I belive this problem was already issued before in original tonerdo/pose (tonerdo/pose#11) but I think it remained unaddressed. The problem occures when I want to access e.g. standard collection as queryable from inside of the isolated code e.g.:

internal class Program
{
     public static IQueryable<int> GetInts()
     {
         return null;
     }
     static void Main(string[] args)
     {
         List<int> ints = new List<int>();
         ints.Add(1);
         var getIntsShim = Pose.Shim.Replace(() => Program.GetInts())
             .With(() => ints.AsQueryable());
         Pose.PoseContext.Isolate(() =>
         {
             Console.WriteLine(Program.GetInts().Count());
         }, getIntsShim);
         Console.ReadLine();
     }
}

Isolated code seemed to get null (or at least perceives obtained object as a null).

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestion/investigationFurther information or investigation is required

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions