Corrected some tests

Minor code refactor
Main page now correctly shows save page even when opening a DB from Explorer
This commit is contained in:
2018-09-12 12:58:32 +02:00
parent 38e2d1ac51
commit d341535d60
11 changed files with 50 additions and 56 deletions

View File

@@ -3,21 +3,24 @@ using System.Collections.ObjectModel;
using System.Threading.Tasks;
using ModernKeePass.Interfaces;
using Windows.Storage;
using System.Collections.Generic;
namespace ModernKeePassApp.Test.Mock
{
class RecentServiceMock : IRecentService
{
private Dictionary<string, IStorageItem> _recentItems = new Dictionary<string, IStorageItem>();
public int EntryCount => 0;
public void Add(IStorageItem file, string metadata)
{
throw new NotImplementedException();
_recentItems.Add(metadata, file);
}
public void ClearAll()
{
throw new NotImplementedException();
_recentItems.Clear();
}
public ObservableCollection<IRecentItem> GetAllFiles(bool removeIfNonExistant = true)
@@ -27,7 +30,7 @@ namespace ModernKeePassApp.Test.Mock
public Task<IStorageItem> GetFileAsync(string token)
{
throw new NotImplementedException();
return Task.Run(() => _recentItems[token]);
}
}
}