I am having a lot of trouble understanding the behaviour of static mocking. I have a static class with two static functions, each of which returns a string, I have a test class whose constructor calls both functions on the static class, and I have a set of tests that arrange only one of the static functions, and which call SetupStatic in various ways. The results are as follows:
1. SetupStatic is not called at all: the arranged function uses the mock arrangement and gets the arranged return value, the other function calls the original - as expected;
2. SetupStatic(MyType, Behavior.Strict) is called: the arranged function uses the mock arrangement and gets the arranged return value, the other function throws a "Called unarranged member on strict mock" exception - as expected;
3. SetupStatic(MyType) is called (ie. default Behavior): the arranged function uses the mock arrangement and gets the arranged return value, the other function does not call the original and gets an empty string as the return value - unexpected;
4. SetupStatic(MyType, Behaviour.Loose) is called: the arranged function uses the mock arrangement and gets the arranged return value, the other function does not call the original and gets null as the return value - doubly unexpected as the documented default value of Behavior is Loose;
5. SetupStatic(MyType, Behaviour.RecursiveLoose) is called: the arranged function uses the mock arrangement and gets the arranged return value, the other function does not call the original and gets an empty string as the return value - unexpected;
6. SetupStatic(MyType, Behavior.CallOriginal) is called: the arranged function uses the mock arrangement and gets the arranged return value, the other function calls the original - I'm not sure what I would expect for this;
I am using JustMock version R2 2019 SP1.
I would be grateful if someone could tell me if this is working correctly, and what the logic is behind this behaviour.
Thanks