I am currently working on unit tests for the Xamarin MvvmCross application using SQLite.Net-PCL 3.1.1. The unit test project is a regular .NET project.
So now I'm mocking MvxSqliteConnectionFactoryBase
public class MockMvxSqliteConnectionFactoryBase : MvxSqliteConnectionFactoryBase
{
#region implemented abstract members of MvxSqliteConnectionFactoryBase
public override string GetPlattformDatabasePath(string databaseName)
{
return "Data Source=:memory:";
}
public override ISQLitePlatform GetCurrentPlatform()
{
return new SQLite.Net.Platform.Generic.SQLitePlatformGeneric();
}
public override ISQLitePlatform GetCurrentPlatform(string key)
{
return new SQLite.Net.Platform.Generic.SQLitePlatformGeneric();
}
#endregion
}
But the database is not created in memory, not in the binproject folder .
I tried to initialize SQLiteConnectionas follows, but there is no constructor that accepts only one line.
source
share