Search code examples
unit-testingvisual-studio-2017

Tests showing twice in Unit Tests pad - Visual Studio 2017 for Mac


In a new project for which I'm creating UITests, my Tests (iOS) and Tests (Android) are showing twice.

If it was just a display artefact I could live with it, however when I run a test, it runs twice!

I've tried:

  • Cleaning the solution
  • Obliterating output paths
  • Editing the UITest project file to see if there are any duplicate references etc.
  • Deleting the Visual Studio cache folder

This problem is only occurring on this new project. Previous projects are fine.

Thoughts?

Version details:

=== Visual Studio Community 2017 for Mac ===

Version 7.8.2 (build 1) Installation UUID: 650b4c91-c7f5-4ee5-ad70-6f178f314906 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 5.0.0.0 ( / b40230c0)

Package version: 516000221

=== Mono Framework MDK ===

Runtime: Mono 5.16.0.221 (2018-06/b63e5378e38) (64-bit) Package version: 516000221

=== NuGet ===

Version: 4.8.0.5385

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 2.1.8 2.1.5 2.1.2 2.1.1 2.0.5 SDK: /usr/local/share/dotnet/sdk/2.1.504/Sdks SDK Versions: 2.1.504 2.1.403 2.1.302 2.1.301 2.1.4 MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.4 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 10.1 (14460.46) Build 10B61

=== Xamarin.Mac ===

Version: 5.2.1.15 (Visual Studio Community) Hash: d60abd198 Branch: Build date: 2019-02-01 12:23:30-0500

=== Xamarin.iOS ===

Version: 12.2.1.15 (Visual Studio Community) Hash: d60abd198 Branch: d15-9 Build date: 2019-02-01 12:23:29-0500

=== Xamarin.Android ===

Version: 9.1.8.0 (Visual Studio Community) Android SDK: /Users/jameslavery/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 2.3 (API level 10) 4.0.3 (API level 15) 4.1 (API level 16) 4.3 (API level 18) 4.4 (API level 19) 5.0 (API level 21) 5.1 (API level 22) 6.0 (API level 23) 7.0 (API level 24) 7.1 (API level 25) 8.0 (API level 26) 8.1 (API level 27)

SDK Tools Version: 26.1.1 SDK Platform Tools Version: 28.0.0 SDK Build Tools Version: 26.0.2

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/jameslavery/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25 1.8.0-25 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL

=== Android Device Manager ===

Version: 7.8.1.0 Hash: 8924ea4a

=== Xamarin Inspector ===

Version: 1.4.3 Hash: db27525 Branch: 1.4-release Build date: Mon, 09 Jul 2018 21:20:18 GMT Client compatibility: 1

=== Build Information ===

Release ID: 708020001 Git revision: 13e0e5b7e85ffe742957e6f204bab5c06c644f0e Build date: 2019-02-27 19:33:14+00 Build branch: release-7.8 Xamarin extensions: 23eaa7c9cdc9a3f55be7bb87b485a790ec82ef25

=== Operating System ===

Mac OS X 10.13.6 Darwin 17.7.0 Darwin Kernel Version 17.7.0 Fri Nov 2 20:43:16 PDT 2018 root:xnu-4570.71.17~1/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

LiveXAML 1.3.31 MFractor 3.7.11 MvvmCross Template pack 2.0.1 NuGet Package Management Extensions 0.16 Template Creator 0.4 Redth's Addins 1.0.9 Internet of Things (IoT) development (Preview) 7.5


Solution

  • The problem was caused by my Tests class inheriting from a BaseTestFixture class and both of them having the

    [TestFixture(Platform.Android)]
    [TestFixture(Platform.iOS)]
    

    attributes.

    Removing these attributes from my derived class solved the problem.