public void UITestsTest ()
{
context.CakeContext.NuGetRestore ("./TestProjects/HelloWorldAndroid/HelloWorldAndroid.sln");
// Try and find a console runner from the installed nugets
var nunitConsolePath = context.CakeContext.GetFiles ("./TestProjects/HelloWorldAndroid/**/nunit-console.exe")
.FirstOrDefault ();
// Build the sln so the unit tests assembly gets built
context.CakeContext.DotNetBuild ("./TestProjects/HelloWorldAndroid/HelloWorldAndroid.sln");
// Build the .apk to test
var apk = context.CakeContext.AndroidPackage ("./TestProjects/HelloWorldAndroid/HelloWorldAndroid/HelloWorldAndroid.csproj");
// Copy to the expected location of the UITests
context.CakeContext.CopyFile (apk, "./TestProjects/HelloWorldAndroid/HelloWorldAndroid.UITests/bin/Debug/app.apk");
try {
// Run the uitests
context.CakeContext.UITest ("./TestProjects/HelloWorldAndroid/HelloWorldAndroid.UITests/bin/Debug/HelloWorldAndroid.UITests.dll",
new Cake.Common.Tools.NUnit.NUnitSettings {
ToolPath = nunitConsolePath
});
} catch (Exception ex) {
Console.WriteLine (ex);
Console.WriteLine (context.GetLogs ());
Assert.Fail (context.GetLogs ());
}
}