chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
All my test class derived from a class called FrameworkTestBase.

It worked fine until I moved my MockManager.Init() into the test initialise from the individual tests.

Now I get a null object exception from this code MockManager.Init():
    [TestClass()]
    public class FrameworkTestBase : TestCommonBase
    {
        [TestInitialize()]
        public void MyTestInitialize()
        {
            try
            {
                MockManager.Init();

     ... Some more code
            }
            catch (Exception e)
            {
                ... Some error handling
     throw;
            }
        }
    }


The stacktrace reads:

" at q.f() at TypeMock.MockManager.Init(Boolean collectAllCalls) at TypeMock.MockManager.Init() at Company.Test.Harness.FrameworkTestBase.MyTestInitialize() in C:\Projects\Company\Test\Harness\FrameworkTestBase.cs:line 52"

Any idea why this would happen?
asked by kerryr (1.8k points)

1 Answer

0 votes
Never mind got it. I'm on my home machine and didn't install the typemock library locally.
answered by kerryr (1.8k points)
...