keepass2android/src/Kp2aUnitTests/TestIntentsAndBundles.cs
Philipp Crocoll bcbc225652 refactoring regarding AppTasks:
- AppTasks are now returned by ActivityResult through all AppTask-Related activities (includes ForwardResult)
 - AppTasks are now passed correctly even when using search (this fixes a problem that AppTasks like SearchUrl were not passed to EntryActivity so the App didn't return to the browser automatically)
 - AppTasks are deleted by ActivityResult or by checking for LaunchedFromHistory

Added option to leave app with db unlocked (this is even the default now!)

Added missing EntryActivity files
2014-05-16 17:15:43 +02:00

34 lines
782 B
C#

using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Java.IO;
using KeePassLib;
using KeePassLib.Interfaces;
using KeePassLib.Keys;
using KeePassLib.Serialization;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using keepass2android;
namespace Kp2aUnitTests
{
[TestClass]
internal class TestIntentsAndBundles
{
[TestMethod]
public void StringArray()
{
string[] dataIn = new string[] { "a","bcd"};
Intent i= new Intent();
i.PutExtra("key", dataIn);
Bundle extras = i.Extras;
var dataOut = extras.GetStringArray("key");
Assert.AreEqual(dataIn.Length, dataOut.Length);
Assert.AreEqual(dataIn[0], dataOut[0]);
Assert.AreEqual(dataIn[1], dataOut[1]);
}
}
}