Bug 23314 - Template for iOS Unit Tests does not behave as expected in Visual Studio
Summary: Template for iOS Unit Tests does not behave as expected in Visual Studio
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.6
Hardware: PC Windows
: Normal normal
Target Milestone: 15.3
Assignee: Bugzilla
Depends on:
Reported: 2014-09-23 17:52 UTC by Dominic N [MSFT]
Modified: 2017-06-28 17:07 UTC (History)
7 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Dominic N [MSFT] 2014-09-23 17:52:40 UTC
## Overview:

After working with a customer experiencing issues with iOS unit tests, we noticed the template for iOS unit test projects in Visual Studio is not behaving as expected.

If a Unit Test project for iOS is created in Xamarin Studio and then brought into Visual Studio, everything works correctly and as expected. However, creating a new “Visual C# -> iOS -> Unit Test App (iOS)” project in Visual Studio results in the inability to add PCL projects to said project.

Additionally, if a test [1] is added to the current Visual Studio template, the test runner app crashes on startup with the following exception:

nhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoTouch.NUnit.UI.TouchViewController.GetAwesomeIcon (System.Action`1 render) [0x00029] in /Developer/MonoTouch/Source/Touch.Unit/NUnitLite/TouchRunner/TouchViewController.cs:263 
  at MonoTouch.NUnit.UI.TouchViewController.get_ArrowDown () [0x0000a] in /Developer/MonoTouch/Source/Touch.Unit/NUnitLite/TouchRunner/TouchViewController.cs:217 
  at MonoTouch.NUnit.UI.TouchViewController..ctor (MonoTouch.Dialog.RootElement root) [0x00020] in /Developer/MonoTouch/Source/Touch.Unit/NUnitLite/TouchRunner/TouchViewController.cs:51 
  at MonoTouch.NUnit.UI.TouchRunner.Setup (NUnit.Framework.Internal.TestSuite suite) [0x0012a] in /Developer/MonoTouch/Source/Touch.Unit/NUnitLite/TouchRunner/TouchRunner.cs:377 
  at MonoTouch.NUnit.UI.TouchRunner.Setup (NUnit.Framework.Internal.TestSuite suite) [0x0007f] in /Developer/MonoTouch/Source/Touch.Unit/NUnitLite/TouchRunner/TouchRunner.cs:351 
  at MonoTouch.NUnit.UI.
TouchRunner+<GetViewController>c__AnonStorey0.<>m__2 () [0x00027] in /Developer/MonoTouch/Source/Touch.Unit/NUnitLite/TouchRunner/TouchRunner.cs:129 
  at Foundation.NSActionDispatcher.Apply () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00000] in <filename unknown>:0 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00000] in <filename unknown>:0 
  at MyUnitTestApp1.Application.Main (System.String[] args) [0x00001] in c:\Users\Windows User\Desktop\MyUnitTestApp1\MyUnitTestApp1\Main.cs:17

[1] E.g.:

public void MyTest()

## Steps to Reproduce:

1. Creating a new “Visual C# -> iOS -> Unit Test App (iOS)” project in Visual Studio
2. Attempt to add a PCL project to this Unit Test App

## Actual Results

Can not add PCL project to Unit Test App.

## Expected Results

Can add PCL project to Unit Test App.

## Version Information

Xamarin for Visual Studio 3.6.245
Comment 2 Rajneesh Kumar 2014-09-24 04:46:21 UTC
I have checked this issue and able to reproduce . To reproduce this issue I have followed the steps mentioned in above bug description.

Steps I have followed:

1. Create a "Unit Test App (iOS)” project in Visual Studio
2. Add a PCL project to this Unit Test App
3. Observed that user is not able to add PCL project

Please let me know if you are facing the same experience ? If no, Could you please let me know what steps I am missing to reproduce this.

Screencast: http://www.screencast.com/t/gHpsuptD9ms

Environment Info: 

Microsoft Visual Studio Professional 2012
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.50709

Xamarin (49abddaaec0a8be4cb890b8cddefed81727bbe6c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (2a7b68212b17c903160fbd8e0106babb299d1be3)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS (b38baf1c655f9fe816fee25cbd7ac78225def3e9)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 3 Jose Gallardo 2016-12-22 21:01:04 UTC
Moving to Confirmed, as per Comment 2
We need to check if it's still an issue currently.
Comment 4 Juan Marcelo Tondato 2017-06-28 17:07:10 UTC
This is no longer reproducible in the current stable release.