Last Updated: 12 Oct 2018 10:29 by ADMIN
Created on: 22 Mar 2017 07:40
Type: Bug Report
Exception when mocking three or more layers deep with CreateLike<>
When using Mock.CreateLike<> we've found that trying to directly mock anything lower than two layers down on a concrete class (e.g. x => x.Layer1.Layer2.Property == "test") throws a NullReferenceException unless the profiler is enabled. It wasn't clear in the exception or the documentation relating to this method that the real issue was the profiler being disabled, and only by trial and error did we find the solution.
1 comment
Posted on: 12 Oct 2018 10:29
Hello Sean,
I am afraid I couldn't reproduce the described behavior. If it still bothers you could you provide more information about the problem? Like, simple test example and the code implementation. This way we would be able to reproduce the problem and find a fix.