This repository has been archived by the owner on Jun 3, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chamoda Pandithage
committed
May 26, 2018
0 parents
commit b0b9341
Showing
21 changed files
with
888 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Autosave files | ||
*~ | ||
|
||
# build | ||
[Oo]bj/ | ||
[Bb]in/ | ||
packages/ | ||
TestResults/ | ||
|
||
# globs | ||
Makefile.in | ||
*.DS_Store | ||
*.sln.cache | ||
*.suo | ||
*.cache | ||
*.pidb | ||
*.userprefs | ||
*.usertasks | ||
config.log | ||
config.make | ||
config.status | ||
aclocal.m4 | ||
install-sh | ||
autom4te.cache/ | ||
*.user | ||
*.tar.gz | ||
tarballs/ | ||
test-results/ | ||
Thumbs.db | ||
.vs/ | ||
|
||
# Mac bundle stuff | ||
*.dmg | ||
*.app | ||
|
||
# resharper | ||
*_Resharper.* | ||
*.Resharper | ||
|
||
# dotCover | ||
*.dotCover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using Xamarin.UITest; | ||
using Xamarin.UITest.Queries; | ||
|
||
namespace XamarinOpenCV.UITests | ||
{ | ||
public class AppInitializer | ||
{ | ||
public static IApp StartApp(Platform platform) | ||
{ | ||
if (platform == Platform.Android) | ||
{ | ||
return ConfigureApp.Android.StartApp(); | ||
} | ||
|
||
return ConfigureApp.iOS.StartApp(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using NUnit.Framework; | ||
using Xamarin.UITest; | ||
using Xamarin.UITest.Queries; | ||
|
||
namespace XamarinOpenCV.UITests | ||
{ | ||
[TestFixture(Platform.Android)] | ||
[TestFixture(Platform.iOS)] | ||
public class Tests | ||
{ | ||
IApp app; | ||
Platform platform; | ||
|
||
public Tests(Platform platform) | ||
{ | ||
this.platform = platform; | ||
} | ||
|
||
[SetUp] | ||
public void BeforeEachTest() | ||
{ | ||
app = AppInitializer.StartApp(platform); | ||
} | ||
|
||
[Test] | ||
public void ClickingButtonTwiceShouldChangeItsLabel() | ||
{ | ||
Func<AppQuery, AppQuery> button = c => c.Button("myButton"); | ||
|
||
app.Tap(button); | ||
app.Tap(button); | ||
AppResult[] results = app.Query(button); | ||
app.Screenshot("Button clicked twice."); | ||
|
||
Assert.AreEqual("2 clicks!", results[0].Text ?? results[0].Label); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{7647C980-D251-43B1-8D35-AA000E8D0ACB}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>XamarinOpenCV.UITests</RootNamespace> | ||
<AssemblyName>XamarinOpenCV.UITests</AssemblyName> | ||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG;</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="nunit.framework"> | ||
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Xamarin.UITest"> | ||
<HintPath>..\packages\Xamarin.UITest.2.0.6\lib\Xamarin.UITest.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\iOS\XamarinOpenCV.iOS.csproj"> | ||
<Project>{9BFC5277-8666-4245-94AD-DB8FC451C2EA}</Project> | ||
<Name>XamarinOpenCV.iOS</Name> | ||
<ReferenceOutputAssembly>False</ReferenceOutputAssembly> | ||
<Private>False</Private> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Tests.cs" /> | ||
<Compile Include="AppInitializer.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="NUnit" version="2.6.3" targetFramework="net461" /> | ||
<package id="Xamarin.UITest" version="2.0.6" targetFramework="net461" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2012 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinOpenCV", "XamarinOpenCV\XamarinOpenCV.csproj", "{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinOpenCV.iOS", "iOS\XamarinOpenCV.iOS.csproj", "{9BFC5277-8666-4245-94AD-DB8FC451C2EA}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinOpenCV.UITests", "UITests\XamarinOpenCV.UITests.csproj", "{7647C980-D251-43B1-8D35-AA000E8D0ACB}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
Debug|iPhoneSimulator = Debug|iPhoneSimulator | ||
Release|iPhone = Release|iPhone | ||
Release|iPhoneSimulator = Release|iPhoneSimulator | ||
Debug|iPhone = Debug|iPhone | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Release|iPhone.ActiveCfg = Release|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Release|iPhone.Build.0 = Release|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Release|iPhoneSimulator.Build.0 = Release|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Debug|iPhone.ActiveCfg = Debug|Any CPU | ||
{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}.Debug|iPhone.Build.0 = Debug|Any CPU | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Release|Any CPU.ActiveCfg = Release|iPhone | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Release|Any CPU.Build.0 = Release|iPhone | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Release|iPhone.ActiveCfg = Release|iPhone | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Release|iPhone.Build.0 = Release|iPhone | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Debug|iPhone.ActiveCfg = Debug|iPhone | ||
{9BFC5277-8666-4245-94AD-DB8FC451C2EA}.Debug|iPhone.Build.0 = Debug|iPhone | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Release|iPhone.ActiveCfg = Release|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Release|iPhone.Build.0 = Release|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Debug|iPhone.ActiveCfg = Debug|Any CPU | ||
{7647C980-D251-43B1-8D35-AA000E8D0ACB}.Debug|iPhone.Build.0 = Debug|Any CPU | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
namespace XamarinOpenCV | ||
{ | ||
public class MyClass | ||
{ | ||
public MyClass() | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
|
||
// Information about this assembly is defined by the following attributes. | ||
// Change them to the values specific to your project. | ||
|
||
[assembly: AssemblyTitle("XamarinOpenCV")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("")] | ||
[assembly: AssemblyCopyright("${AuthorCopyright}")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". | ||
// The form "{Major}.{Minor}.*" will automatically update the build and revision, | ||
// and "{Major}.{Minor}.{Build}.*" will update just the revision. | ||
|
||
[assembly: AssemblyVersion("1.0.*")] | ||
|
||
// The following attributes are used to specify the signing key for the assembly, | ||
// if desired. See the Mono documentation for more information about signing. | ||
|
||
//[assembly: AssemblyDelaySign(false)] | ||
//[assembly: AssemblyKeyFile("")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{0384A03D-B24E-4463-9FE5-2DD2BDE9A010}</ProjectGuid> | ||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<UseMSBuildEngine>true</UseMSBuildEngine> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>XamarinOpenCV</RootNamespace> | ||
<AssemblyName>XamarinOpenCV</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<TargetFrameworkProfile>Profile111</TargetFrameworkProfile> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG;</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="MyClass.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using Foundation; | ||
using UIKit; | ||
|
||
namespace XamarinOpenCV.iOS | ||
{ | ||
// The UIApplicationDelegate for the application. This class is responsible for launching the | ||
// User Interface of the application, as well as listening (and optionally responding) to application events from iOS. | ||
[Register("AppDelegate")] | ||
public class AppDelegate : UIApplicationDelegate | ||
{ | ||
// class-level declarations | ||
|
||
public override UIWindow Window | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) | ||
{ | ||
// Override point for customization after application launch. | ||
// If not required for your application you can safely delete this method | ||
|
||
// Code to start the Xamarin Test Cloud Agent | ||
#if ENABLE_TEST_CLOUD | ||
Xamarin.Calabash.Start(); | ||
#endif | ||
|
||
return true; | ||
} | ||
|
||
public override void OnResignActivation(UIApplication application) | ||
{ | ||
// Invoked when the application is about to move from active to inactive state. | ||
// This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) | ||
// or when the user quits the application and it begins the transition to the background state. | ||
// Games should use this method to pause the game. | ||
} | ||
|
||
public override void DidEnterBackground(UIApplication application) | ||
{ | ||
// Use this method to release shared resources, save user data, invalidate timers and store the application state. | ||
// If your application supports background exection this method is called instead of WillTerminate when the user quits. | ||
} | ||
|
||
public override void WillEnterForeground(UIApplication application) | ||
{ | ||
// Called as part of the transiton from background to active state. | ||
// Here you can undo many of the changes made on entering the background. | ||
} | ||
|
||
public override void OnActivated(UIApplication application) | ||
{ | ||
// Restart any tasks that were paused (or not yet started) while the application was inactive. | ||
// If the application was previously in the background, optionally refresh the user interface. | ||
} | ||
|
||
public override void WillTerminate(UIApplication application) | ||
{ | ||
// Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground. | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.