While running NUnit tests, running all works fine. Running an individual fixture breaks all others.

CollinIrwinCollinIrwin USMember ✭✭
edited July 2015 in Xamarin.iOS

I am using the IOS Unit Tests project to do some unit testing. If I 'run everything' or 'run all', then all the tests seem to work fine.

However, if I individually run a single set of tests with 'run all' (single fixture, single class), all other tests begin failing.

These are examples of the errors I get (although I get 30 of them):

    2015-07-27 14:14:30.284 Elvis.IOSUnitTest[20825:455585]     [FAIL] IsForFuture : System.Reflection.TargetException : Object of type 'SharedUnitTests.LocatorInstanceTests' doesn't match target type 'SharedUnitTests.VisitTests'
    > 2015-07-27 14:14:30.284 Elvis.IOSUnitTest[20825:455585]         at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00069] in /Users/builder/data/lanes/1962/8b265d64/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:242 
    > 2015-07-27 14:14:30.284 Elvis.IOSUnitTest[20825:455585]         at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builder/data/lanes/1962/8b265d64/source/mono/mcs/class/corlib/System.Reflection/MethodBase.cs:114 
    > 2015-07-27 14:14:30.284 Elvis.IOSUnitTest[20825:455585]         at NUnit.Framework.Internal.Reflect.InvokeMethod (System.Reflection.MethodInfo method, System.Object fixture, System.Object[] args) [0x0000c] in /Users/builder/data/lanes/1962/8b265d64/source/NUnitLite/NUnitLite-1.0.0/src/framework/Internal/Reflect.cs:215 
    > 2015-07-27 14:14:30.285 Elvis.IOSUnitTest[20825:455585]   [FAIL] IsForNow : System.Reflection.TargetException : Object of type 'SharedUnitTests.LocatorInstanceTests' doesn't match target type 'SharedUnitTests.VisitTests'
    > 2015-07-27 14:14:30.285 Elvis.IOSUnitTest[20825:455585]         at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00069] in /Users/builder/data/lanes/1962/8b265d64/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:242 
    > 2015-07-27 14:14:30.285 Elvis.IOSUnitTest[20825:455585]         at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builder/data/lanes/1962/8b265d64/source/mono/mcs/class/corlib/System.Reflection/MethodBase.cs:114 
    > 2015-07-27 14:14:30.285 Elvis.IOSUnitTest[20825:455585]         at NUnit.Framework.Internal.Reflect.InvokeMethod (System.Reflection.MethodInfo method, System.Object fixture, System.Object[] args) [0x0000c] in /Users/builder/data/lanes/1962/8b265d64/source/NUnitLite/NUnitLite-1.0.0/src/framework/Internal/Reflect.cs:215 

All of them are of the same form. Reflection exception stating that A doesn't match B, where B is the test it is attempting to run and A is the individual test fixture I ran to break everything.

Any one have any idea why this might be happening? I'm about to give up on testing considering the project is almost complete anyway and I failed to start the project with testing in mind (although in the future I will be sure to test from the beginning).

Answers

  • CaptainXamtasticCaptainXamtastic GBUniversity ✭✭✭

    We have exactly the same issue on Visual Studio 2015

  • FionaCFionaC IEMember ✭✭

    I'm also having this issue with the latest stable build of Xamarin for VS (9.8)

  • IgorIgor USMember

    Same issue, Xamarin studio 6.2.1, NUnitLite tests.
    Looks like the test runner issue

Sign In or Register to comment.