Dear Telerik team,
my problem is the following: I have a static class called
Context. Its data is needed in the system under test. I have two Test classes (let's say
Foo and
Bar). In
Foo I use some methods to manually load all the stuff from the database into my Context. So I actually use it like it works in the real application. In
Bar, though, I use static mocking to mock
Context. Now it should look like follows:
- If I load all the stuff from the database there is a CodeDictionary with a big amount of entries (Foo)
- The mock is like Mock.Arrange(() => CodeDictionary[specificId]).Returns(specificValue) (Bar)
If I run them by theirselves everything works fine. But if a run both test classes at the same time they seem to interfere each other. If I debug the
Bar class while running all the tests at the same time I just saw the this CodeDictionary is filled with the codes from the database. That's not the behaviour I expected. How could I get around with this?
This post could not help me.