├── tests
├── nunit.runner.tests.iOS
│ ├── iTunesArtwork
│ ├── iTunesArtwork@2x
│ ├── Resources
│ │ ├── Default.png
│ │ ├── Icon-76.png
│ │ ├── Default@2x.png
│ │ ├── Icon-60@2x.png
│ │ ├── Icon-60@3x.png
│ │ ├── Icon-76@2x.png
│ │ ├── Icon-Small.png
│ │ ├── Icon-Small-40.png
│ │ ├── Icon-Small@2x.png
│ │ ├── Icon-Small@3x.png
│ │ ├── Default-568h@2x.png
│ │ ├── Default-Portrait.png
│ │ ├── Icon-Small-40@2x.png
│ │ ├── Icon-Small-40@3x.png
│ │ ├── Default-Portrait@2x.png
│ │ └── LaunchScreen.storyboard
│ ├── Entitlements.plist
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Main.cs
│ ├── Info.plist
│ ├── AppDelegate.cs
│ └── nunit.runner.tests.iOS.csproj
├── nunit.runner.tests.uwp
│ ├── Assets
│ │ ├── StoreLogo.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ └── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── App.xaml
│ ├── MainPage.xaml
│ ├── Properties
│ │ ├── Default.rd.xml
│ │ └── AssemblyInfo.cs
│ ├── Package.appxmanifest
│ ├── MainPage.xaml.cs
│ ├── App.xaml.cs
│ └── nunit.runner.tests.uwp.csproj
├── nunit.runner.tests.Droid
│ ├── Resources
│ │ ├── drawable
│ │ │ └── icon.png
│ │ ├── drawable-hdpi
│ │ │ └── icon.png
│ │ ├── drawable-xhdpi
│ │ │ └── icon.png
│ │ ├── drawable-xxhdpi
│ │ │ └── icon.png
│ │ └── AboutResources.txt
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── MainActivity.cs
│ └── nunit.runner.tests.Droid.csproj
└── nunit.runner.tests
│ ├── nunit.runner.tests.projitems
│ ├── nunit.runner.tests.shproj
│ ├── Properties
│ └── AssemblyInfoCommon.cs
│ ├── TestCaseSample.cs
│ ├── AsyncTests.cs
│ └── TestsSample.cs
├── tools
└── packages.config
├── appveyor.yml
├── NuGet.config
├── .editorconfig
├── LICENSE.txt
├── src
└── nunit.xamarin
│ ├── App.xaml
│ ├── nunit.xamarin.csproj
│ ├── View
│ ├── TestView.xaml.cs
│ ├── ResultsView.xaml.cs
│ ├── ResultsView.xaml
│ ├── TestView.xaml
│ ├── SummaryView.xaml.cs
│ └── SummaryView.xaml
│ ├── Messages
│ └── ErrorMessage.cs
│ ├── ViewModel
│ ├── BaseViewModel.cs
│ ├── ResultViewModel.cs
│ ├── TestViewModel.cs
│ ├── ResultsViewModel.cs
│ └── SummaryViewModel.cs
│ ├── Services
│ ├── TestResultProcessor.cs
│ ├── XmlFileProcessor.cs
│ ├── TcpWriterProcessor.cs
│ ├── TestOptions.cs
│ ├── TcpWriterInfo.cs
│ └── TcpWriter.cs
│ ├── Helpers
│ ├── TestRunResult.cs
│ ├── TestPackage.cs
│ └── ResultSummary.cs
│ ├── Extensions
│ └── XamarinExtensions.cs
│ └── App.xaml.cs
├── CHANGES.md
├── README.md
├── .gitattributes
├── CODE_OF_CONDUCT.md
├── .gitignore
├── nunit.runner.sln.DotSettings
└── nunit.xamarin.sln
/tests/nunit.runner.tests.iOS/iTunesArtwork:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/iTunesArtwork
--------------------------------------------------------------------------------
/tools/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/iTunesArtwork@2x:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/iTunesArtwork@2x
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | image: Visual Studio 2017
2 |
3 | build_script:
4 | - ps: .\build.ps1 -Target Appveyor
5 |
6 | # disable built-in tests.
7 | test: off
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.uwp/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Icon-76.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Icon-60@2x.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Icon-60@3x.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Icon-76@2x.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Icon-Small.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Icon-Small-40.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Icon-Small@2x.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Icon-Small@3x.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.Droid/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.Droid/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.Droid/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.Droid/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.Droid/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.Droid/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.uwp/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.uwp/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.Droid/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.Droid/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.uwp/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.uwp/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.uwp/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nunit/nunit.xamarin/HEAD/tests/nunit.runner.tests.uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/NuGet.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and
2 | # maintain consistent coding styles between
3 | # different editors and IDEs
4 |
5 | # http://EditorConfig.org
6 |
7 | # top-most EditorConfig file
8 | root = true
9 |
10 | [*]
11 | indent_style = space
12 | indent_size = 4
13 |
14 | [*.csproj]
15 | indent_style = space
16 | indent_size = 2
17 |
18 | [*.vcxproj]
19 | indent_style = space
20 | indent_size = 2
21 |
22 | [*.config]
23 | indent_style = space
24 | indent_size = 2
25 |
26 | [NUnit.proj]
27 | indent_style = tab
28 | indent_size = 2
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests/nunit.runner.tests.projitems:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
5 | true
6 | AF293652-BAA0-4813-B4F3-2D5A2CDDE0B4
7 |
8 |
9 | NUnit.Runner.Tests
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests/nunit.runner.tests.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AF293652-BAA0-4813-B4F3-2D5A2CDDE0B4
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2017 NUnit Project
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
21 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/nunit.xamarin/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
12 |
15 |
16 |
17 |
25 |
26 |
27 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015 CNUnit Project
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining
4 | // a copy of this software and associated documentation files (the
5 | // "Software"), to deal in the Software without restriction, including
6 | // without limitation the rights to use, copy, modify, merge, publish,
7 | // distribute, sublicense, and/or sell copies of the Software, and to
8 | // permit persons to whom the Software is furnished to do so, subject to
9 | // the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be
12 | // included in all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 | // ***********************************************************************
22 |
23 | using System.Reflection;
24 |
25 | [assembly: AssemblyTitle("NUnit.Runner.Tests.iOS")]
26 | [assembly: AssemblyDescription("Unit Tests for NUnit Test Runner for iOS")]
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2018 NUnit Project
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining
4 | // a copy of this software and associated documentation files (the
5 | // "Software"), to deal in the Software without restriction, including
6 | // without limitation the rights to use, copy, modify, merge, publish,
7 | // distribute, sublicense, and/or sell copies of the Software, and to
8 | // permit persons to whom the Software is furnished to do so, subject to
9 | // the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be
12 | // included in all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 | // ***********************************************************************
22 |
23 | using System.Reflection;
24 |
25 | [assembly: AssemblyTitle("NUnit.Runner.Tests.Droid")]
26 | [assembly: AssemblyDescription("Unit Tests for NUnit Test Runner for Android")]
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2015 CNUnit Project
2 | //
3 | // Permission is hereby granted, free of charge, to any person obtaining
4 | // a copy of this software and associated documentation files (the
5 | // "Software"), to deal in the Software without restriction, including
6 | // without limitation the rights to use, copy, modify, merge, publish,
7 | // distribute, sublicense, and/or sell copies of the Software, and to
8 | // permit persons to whom the Software is furnished to do so, subject to
9 | // the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be
12 | // included in all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 | // ***********************************************************************
22 |
23 | using System.Reflection;
24 |
25 | [assembly: AssemblyTitle("NUnit.Runner.Tests.UWP")]
26 | [assembly: AssemblyDescription("Unit Tests for NUnit Test Runner for Universal Windows")]
--------------------------------------------------------------------------------
/CHANGES.md:
--------------------------------------------------------------------------------
1 | ### NUnit Xamarin Runner 3.6.1 - March 14, 2017
2 |
3 | This release includes new functionality to write and retrieve a TestResult xml file, via either a TCP port or specified file path. Additional changes are also included to improve intergration with CI systems.
4 |
5 | Windows Phone 8.1 support has been removed in this release.
6 |
7 | #### Issues Resolved
8 |
9 | * 17 Add a TcpListener
10 | * 24 Create a Test Results file
11 | * 51 Update to NUnit 3.5
12 | * 53 Update the README and docs
13 | * 57 String resource Hello without id in Droid Runner project
14 | * 59 Enable adding multiple assemblies to test
15 | * 60 Added TestOption to change xml result file location
16 | * 62 Get AppVeyor build working
17 | * 64 Remove support for Win Phone 8.1
18 | * 65 Update library versions
19 | * 66 Remove Text/UI references to NUnit 3.0
20 | * 70 Make the Icon Larger
21 | * 74 Document framework version dependency of runner
22 | * 84 Allow app to be terminated automatically after running the tests
23 | * 85 Update to NUnit 3.6.1
24 | * 86 Include UWP test runner in CI
25 | * 91 Added a null check in the TestOptions get-method
26 |
27 | ### NUnit Xamarin Runner 3.0.1 - December 3, 2015
28 |
29 | This release updates the test runner to use the new 3.0.1 NUnit Framework which fixes issues with Async tests on Windows 10 UWP.
30 |
31 | ### NUnit Xamarin Runner 3.0.0 - November 18, 2015
32 |
33 | This is the first release of the NUnit Xamarin Runners supporting Android, iOS, Windows Phone 8.1 and Windows 10 Universal Apps.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NUnit 3 Xamarin Runners
2 |
3 | [](https://ci.appveyor.com/project/CharliePoole/nunit-xamarin/branch/master)[](https://www.nuget.org/packages/nunit.xamarin)
4 |
5 | [](https://twitter.com/nunit)
6 |
7 | NUnit test runners for Xamarin and mobile devices. Check out the guides below to get started, or install the [NUnit Visual Studio Templates](https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnitTemplatesforVisualStudio) extension to create a template project. See [Testing Xamarin Projects using NUnit 3](http://www.alteridem.net/2015/12/21/testing-xamarin-projects-using-nunit-3/) for an handy overview.
8 |
9 | - [Documentation](https://github.com/nunit/docs/wiki/NUnit-Xamarin-Runners)
10 | - [Getting Started in Visual Studio](https://github.com/nunit/docs/wiki/Getting-Started-in-Visual-Studio)
11 | - [Getting Started in Visual Studio for Mac](https://github.com/nunit/docs/wiki/Getting-Started-in-Visual-Studio-for-Mac)
12 | - [NUnit Templates for Visual Studio](https://github.com/nunit/nunit-vs-templates)
13 |
14 | ## Contributing
15 | We love pull requests! All NUnit projects are built and maintained entirely by the community, contributions of any kind are welcome. Not sure where to start? Have a look at our [Contributor's guide](https://github.com/nunit/nunit/blob/master/CONTRIBUTING.md).
16 |
17 | Adding something new? We suggest posting an issue first, to run your idea by the team.
--------------------------------------------------------------------------------
/src/nunit.xamarin/nunit.xamarin.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | NUnit
6 | NUnit 3 Xamarin Runner
7 | Copyright (C) 2018, Rob Prouse
8 | 3.10.1
9 |
10 |
11 | nunit.xamarin
12 | NUnit 3 Xamarin Runner
13 | Rob Prouse
14 | https://raw.githubusercontent.com/nunit/nunit.xamarin/master/LICENSE.txt
15 | https://cdn.rawgit.com/nunit/resources/master/images/icon/nunit_256.png
16 | https://github.com/nunit/nunit.xamarin
17 | https://github.com/nunit/nunit.xamarin
18 | git
19 | nunit xamarin android ios monoandroid monotouch tdd unit test testing
20 |
21 | Adds support for running NUnit 3 unit tests on Xamarin
22 |
23 | Supported Xamarin platforms:
24 | - Android
25 | - iOS
26 | - Windows 10 Universal Apps
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | *.xaml
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.uwp/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | nunit.runner.tests.uwp
7 | Rob Prouse
8 | Assets\StoreLogo.png
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/nunit.xamarin/View/TestView.xaml.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2015 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using NUnit.Runner.ViewModel;
25 | using Xamarin.Forms;
26 |
27 | namespace NUnit.Runner.View
28 | {
29 | ///
30 | /// Xamarin.Forms view of an individual test result
31 | ///
32 | public partial class TestView : ContentPage
33 | {
34 | internal TestView(TestViewModel model)
35 | {
36 | BindingContext = model;
37 | InitializeComponent();
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2015 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using UIKit;
25 |
26 | namespace NUnit.Runner.Tests
27 | {
28 | public class Application
29 | {
30 | // This is the main entry point of the application.
31 | static void Main(string[] args)
32 | {
33 | // if you want to use a different Application Delegate class from "AppDelegate"
34 | // you can specify it here.
35 | UIApplication.Main(args, null, "AppDelegate");
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UISupportedInterfaceOrientations
11 |
12 | UIInterfaceOrientationPortrait
13 | UIInterfaceOrientationLandscapeLeft
14 | UIInterfaceOrientationLandscapeRight
15 |
16 | UISupportedInterfaceOrientations~ipad
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationPortraitUpsideDown
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | MinimumOSVersion
24 | 7.0
25 | CFBundleDisplayName
26 | nunit.runner
27 | CFBundleIdentifier
28 | com.yourcompany.nunit.runner
29 | CFBundleVersion
30 | 1.0
31 | CFBundleIconFiles
32 |
33 | Icon-60@2x
34 | Icon-60@3x
35 | Icon-76
36 | Icon-76@2x
37 | Default
38 | Default@2x
39 | Default-568h@2x
40 | Default-Portrait
41 | Default-Portrait@2x
42 | Icon-Small-40
43 | Icon-Small-40@2x
44 | Icon-Small-40@3x
45 | Icon-Small
46 | Icon-Small@2x
47 | Icon-Small@3x
48 |
49 | UILaunchStoryboardName
50 | LaunchScreen
51 | CFBundleShortVersionString
52 |
53 | UIFileSharingEnabled
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests.Droid/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
51 |
--------------------------------------------------------------------------------
/src/nunit.xamarin/Messages/ErrorMessage.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2017 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | namespace NUnit.Runner.Messages
25 | {
26 | ///
27 | /// Represents an error message
28 | ///
29 | public class ErrorMessage
30 | {
31 | ///
32 | /// The name of this message
33 | ///
34 | public const string Name = nameof(ErrorMessage);
35 |
36 | ///
37 | /// Constructs an with a message
38 | ///
39 | ///
40 | public ErrorMessage(string message)
41 | {
42 | Message = message;
43 | }
44 |
45 | ///
46 | /// The error message
47 | ///
48 | public string Message { get; set; }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/nunit.xamarin/View/ResultsView.xaml.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2015 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using NUnit.Runner.ViewModel;
25 | using Xamarin.Forms;
26 |
27 | namespace NUnit.Runner.View
28 | {
29 | ///
30 | /// Xamarin.Forms view of a list of test results
31 | ///
32 | public partial class ResultsView : ContentPage
33 | {
34 | internal ResultsView (ResultsViewModel model)
35 | {
36 | model.Navigation = Navigation;
37 | BindingContext = model;
38 | InitializeComponent();
39 | }
40 |
41 | internal async void ViewTest(object sender, SelectedItemChangedEventArgs e)
42 | {
43 | var result = e.SelectedItem as ResultViewModel;
44 | if (result != null)
45 | await Navigation.PushAsync(new TestView(new TestViewModel(result.TestResult)));
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/nunit.xamarin/View/ResultsView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/src/nunit.xamarin/ViewModel/BaseViewModel.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2015 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using System.ComponentModel;
25 | using System.Runtime.CompilerServices;
26 | using NUnit.Runner.Annotations;
27 | using Xamarin.Forms;
28 |
29 | namespace NUnit.Runner.ViewModel
30 | {
31 | class BaseViewModel : INotifyPropertyChanged
32 | {
33 | ///
34 | /// So that we can navigate from within the view model
35 | ///
36 | public INavigation Navigation { get; set; }
37 |
38 | public event PropertyChangedEventHandler PropertyChanged;
39 |
40 | [NotifyPropertyChangedInvocator]
41 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
42 | {
43 | PropertyChangedEventHandler handler = PropertyChanged;
44 | if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/src/nunit.xamarin/Services/TestResultProcessor.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2016 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using System.Threading.Tasks;
25 | using NUnit.Runner.Helpers;
26 |
27 | namespace NUnit.Runner.Services
28 | {
29 | abstract class TestResultProcessor
30 | {
31 | protected TestResultProcessor(TestOptions options)
32 | {
33 | Options = options;
34 | }
35 |
36 | protected TestOptions Options { get; private set; }
37 |
38 | protected TestResultProcessor Successor { get; private set; }
39 |
40 | public abstract Task Process(ResultSummary testResult);
41 |
42 | public static TestResultProcessor BuildChainOfResponsability(TestOptions options)
43 | {
44 | var tcpWriter = new TcpWriterProcessor(options);
45 | var xmlFileWriter = new XmlFileProcessor(options);
46 |
47 | tcpWriter.Successor = xmlFileWriter;
48 | return tcpWriter;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests/Properties/AssemblyInfoCommon.cs:
--------------------------------------------------------------------------------
1 | // *********************b**************************************************
2 | // Copyright (c) 2018 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using System.Reflection;
25 | using System.Runtime.InteropServices;
26 |
27 | [assembly: AssemblyProduct("NUnit 3")]
28 | [assembly: AssemblyCopyright("Copyright (C) 2018 NUnit Project")]
29 | [assembly: AssemblyTrademark("NUnit is a trademark of NUnit Software")]
30 | [assembly: AssemblyCulture("")]
31 |
32 | [assembly: AssemblyVersion("3.10.1")]
33 | [assembly: AssemblyFileVersion("3.10.1.0")]
34 |
35 | [assembly: ComVisible(false)]
36 |
37 |
38 | #if DEBUG
39 | #if __IOS__
40 | [assembly: AssemblyConfiguration("iOS Debug")]
41 | #elif __DROID__
42 | [assembly: AssemblyConfiguration("Android Debug")]
43 | #else
44 | [assembly: AssemblyConfiguration("Debug")]
45 | #endif
46 | #else
47 | #if __IOS__
48 | [assembly: AssemblyConfiguration("iOS 4.5")]
49 | #elif __DROID__
50 | [assembly: AssemblyConfiguration("Android 4.0")]
51 | #else
52 | [assembly: AssemblyConfiguration("")]
53 | #endif
54 | #endif
--------------------------------------------------------------------------------
/src/nunit.xamarin/Helpers/TestRunResult.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2017 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using System;
25 | using System.Collections.Generic;
26 | using NUnit.Framework.Interfaces;
27 |
28 | namespace NUnit.Runner.Helpers
29 | {
30 | ///
31 | /// Contains all results from all tests in a
32 | ///
33 | internal class TestRunResult
34 | {
35 | private readonly List _results = new List();
36 |
37 | public DateTime StartTime { get; private set; }
38 | public DateTime EndTime { get; private set; }
39 |
40 | public TestRunResult()
41 | {
42 | StartTime = DateTime.Now;
43 | }
44 |
45 | public void AddResult(ITestResult result)
46 | {
47 | _results.Add(result);
48 | }
49 |
50 | public void CompleteTestRun()
51 | {
52 | EndTime = DateTime.Now;
53 | }
54 |
55 | public IReadOnlyCollection TestResults => _results;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/nunit.xamarin/ViewModel/ResultViewModel.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2015 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using NUnit.Framework.Interfaces;
25 | using NUnit.Runner.Extensions;
26 | using Xamarin.Forms;
27 |
28 | namespace NUnit.Runner.ViewModel
29 | {
30 | internal class ResultViewModel
31 | {
32 | public ResultViewModel(ITestResult result)
33 | {
34 | TestResult = result;
35 | Result = result.ResultState.Status.ToString().ToUpperInvariant();
36 | Name = result.Name;
37 | Parent = result.Test.Parent.FullName;
38 | Message = result.Message;
39 | }
40 |
41 | public ITestResult TestResult { get; private set; }
42 | public string Result { get; set; }
43 | public string Name { get; private set; }
44 | public string Parent { get; private set; }
45 | public string Message { get; private set; }
46 |
47 | ///
48 | /// Gets the color for this result.
49 | ///
50 | public Color Color
51 | {
52 | get { return TestResult.ResultState.Color(); }
53 | }
54 | }
55 | }
--------------------------------------------------------------------------------
/src/nunit.xamarin/View/TestView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests/TestCaseSample.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2015 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using NUnit.Framework;
25 |
26 | namespace NUnit.Runner.Tests
27 | {
28 | [TestFixture]
29 | public class TestCaseSample
30 | {
31 | [TestCase(1, 1, ExpectedResult = 2)]
32 | [TestCase(10, 10, ExpectedResult = 20)]
33 | [TestCase(12, 13, ExpectedResult = 24)] // Deliberate failure
34 | public int TestAddWithResult(int x, int y)
35 | {
36 | return x + y;
37 | }
38 |
39 | [TestCase(1, 1, 2)]
40 | [TestCase(10, 10, 20)]
41 | [TestCase(12, 13, 24)] // Deliberate failure
42 | public void TestAddWithExpected(int x, int y, int expected)
43 | {
44 | Assert.That(x + y, Is.EqualTo(expected));
45 | }
46 |
47 | [Test]
48 | public void TestPassedInParameter()
49 | {
50 | var val = TestContext.Parameters.Get("Parameter");
51 | TestContext.WriteLine("The passed-in value associated with 'Parameter' is: {0}", val?? "null");
52 | Assert.True(val == null || val == "Value");
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/nunit.xamarin/View/SummaryView.xaml.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2015 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using NUnit.Runner.Messages;
25 | using NUnit.Runner.ViewModel;
26 | using Xamarin.Forms;
27 |
28 | namespace NUnit.Runner.View
29 | {
30 | ///
31 | /// The main Xamarin.Forms view of the application
32 | ///
33 | public partial class SummaryView : ContentPage
34 | {
35 | SummaryViewModel _model;
36 |
37 | internal SummaryView (SummaryViewModel model)
38 | {
39 | _model = model;
40 | _model.Navigation = Navigation;
41 | BindingContext = _model;
42 | InitializeComponent();
43 |
44 | MessagingCenter.Subscribe(this, ErrorMessage.Name, error => {
45 | Device.BeginInvokeOnMainThread(async () => await DisplayAlert("Error", error.Message, "OK"));
46 | });
47 | }
48 |
49 | ///
50 | /// Called when the view is appearing
51 | ///
52 | protected override void OnAppearing()
53 | {
54 | base.OnAppearing();
55 | _model.OnAppearing();
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/tests/nunit.runner.tests/AsyncTests.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Copyright (c) 2015 NUnit Project
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining
5 | // a copy of this software and associated documentation files (the
6 | // "Software"), to deal in the Software without restriction, including
7 | // without limitation the rights to use, copy, modify, merge, publish,
8 | // distribute, sublicense, and/or sell copies of the Software, and to
9 | // permit persons to whom the Software is furnished to do so, subject to
10 | // the following conditions:
11 | //
12 | // The above copyright notice and this permission notice shall be
13 | // included in all copies or substantial portions of the Software.
14 | //
15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 | // ***********************************************************************
23 |
24 | using NUnit.Framework;
25 | using System.Threading.Tasks;
26 |
27 | namespace NUnit.Runner.Tests
28 | {
29 | [TestFixture]
30 | public class AsyncTests
31 | {
32 | [Test]
33 | public async Task TestAsyncMethodWithoutReturn()
34 | {
35 | await AsyncMethodWithoutReturn();
36 | Assert.Pass();
37 | }
38 |
39 | [Test]
40 | public async Task TestAsyncMethodWithReturnValueIndirectly()
41 | {
42 | bool actual = await AsyncMethodWithReturnValue();
43 | Assert.That(actual, Is.True);
44 | }
45 |
46 | [Test]
47 | public void TestAsyncMethodWithReturnValueDirectly()
48 | {
49 | Assert.That(async () => await AsyncMethodWithReturnValue(), Is.True);
50 | }
51 |
52 | public async Task AsyncMethodWithoutReturn()
53 | {
54 | await Task.FromResult