mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-20 12:06:29 +02:00
Version 3.0.261
This commit is contained in:
parent
8aa3089f32
commit
4bccfe740b
80 changed files with 2672 additions and 458 deletions
41
TestFramework/Model/User/Account/StoreMock.cs
Normal file
41
TestFramework/Model/User/Account/StoreMock.cs
Normal file
|
@ -0,0 +1,41 @@
|
|||
using System.Threading.Tasks;
|
||||
using TINK.Model.User.Account;
|
||||
|
||||
namespace TestFramework.Model.User.Account
|
||||
{
|
||||
public class StoreMock : IStore
|
||||
{
|
||||
IAccount m_oAccount;
|
||||
|
||||
/// <summary>
|
||||
/// Instantiates
|
||||
/// - a dummy account to simulate a logged in user before end of last session
|
||||
/// - an empty account to simulate no user logged in before end of last session
|
||||
/// </summary>
|
||||
/// <param name="p_oAccount">If null no user is logged in.</param>
|
||||
public StoreMock(IAccount p_oAccount = null)
|
||||
{
|
||||
m_oAccount = new TINK.Model.User.Account.Account(p_oAccount ?? new EmptyAccount());
|
||||
}
|
||||
|
||||
public Task<IAccount> Load()
|
||||
{
|
||||
return Task.FromResult<IAccount>(new TINK.Model.User.Account.Account(m_oAccount));
|
||||
}
|
||||
|
||||
public IAccount Delete(IAccount p_oAccount)
|
||||
{
|
||||
// Set member to empty.
|
||||
m_oAccount = new EmptyAccount();
|
||||
|
||||
// Return empty account.
|
||||
return new EmptyAccount();
|
||||
}
|
||||
|
||||
public Task Save(IAccount p_oAccount)
|
||||
{
|
||||
m_oAccount = new TINK.Model.User.Account.Account(p_oAccount);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue