Support || and ?: in Mock.Of #86

Open
ashmind opened this Issue Jan 28, 2014 · 0 comments

Comments

Projects
None yet
1 participant
Contributor

ashmind commented Jan 28, 2014

I think the x || a and x ? a : b should be supported in Mock.Of as long as x can be calculated immediately when mock is set up.

Example:

Mock.Of<INode>(
    m => m.GetProperty("p1").Value == p1
      && (p2 == null || m.GetProperty("p2").Value == p2)
      && (p3 == null || m.GetProperty("p3").Value == p3)
)

Here p1, p2 and p3 are external variables/parameters.
What should happen is if p2 == null, m.GetProperty("p2") is not mocked at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment