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
Hallo,

we have upgraded to Typemock 7.4.0.0 after doing this some of our tests crashed. Most of them are related to remove the "LoadView"-methods. (WPF)
We get the following error (german):
System.Reflection.TargetInvocationException : Ein Aufrufziel hat einen Ausnahmefehler verursacht.
----> System.TypeInitializationException : Der Typeninitialisierer für "<Module>" hat eine Ausnahme verursacht.
----> <CrtImplementationDetails>.ModuleLoadException : The C++ module failed to load during appdomain initialization.

----> System.NullReferenceException : Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.

Exception has been thrown by the target of an invocation.

Its easy to reproduce:

Class1 (access the view)
    public class Class1
    {
        private MainWindow window;

        public void LoadView()
        {
            window = new MainWindow();
        }

        public void BlaBla()
        {
            LoadView();

        }
    }


TestClass:
    [TestFixture]
    public class TestClass
    {
        [Test]
        public void XX()
        {
            var q = new WpfApplication3.Class1();
            Isolate.WhenCalled(() => q.LoadView()).IgnoreCall(); //crash!

            q.BlaBla();

        }
    }


Hope somebody can help me. Thank you!
asked by Moritz (3.3k points)

3 Answers

0 votes
Hi Moritz,

Thank you for the details.
It does reproduce easily.
We are looking into it and I'll keep you posted.
answered by alex (17k points)
0 votes
Hi Moritz,

This issue is fixed in 7.4.1 and later versions.
We sent you a patch including this fix via email.
answered by NofarC (4k points)
0 votes
Cool, its working!
answered by Moritz (3.3k points)
...