Created a Settings Service

Created a Recent Service
Created a Resources Service
Code refactor
Updated tests
This commit is contained in:
BONNEVILLE Geoffroy
2017-12-01 17:59:38 +01:00
parent f172e31250
commit 744858df81
35 changed files with 552 additions and 141 deletions

View File

@@ -8,7 +8,7 @@ using Windows.Storage;
namespace ModernKeePassApp.Test.Mock
{
public class DatabaseHelperMock : IDatabase
public class DatabaseServiceMock : IDatabase
{
public PwCompressionAlgorithm CompressionAlgorithm { get; set; }

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using ModernKeePass.Interfaces;
using Windows.Storage;
namespace ModernKeePassApp.Test.Mock
{
class RecentServiceMock : IRecent
{
public int EntryCount => 0;
public void Add(IStorageItem file, string metadata)
{
throw new NotImplementedException();
}
public ObservableCollection<IRecentItem> GetAllFiles(bool removeIfNonExistant = true)
{
throw new NotImplementedException();
}
public Task<IStorageItem> GetFileAsync(string token)
{
throw new NotImplementedException();
}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using ModernKeePass.Interfaces;
namespace ModernKeePassApp.Test.Mock
{
class ResourceServiceMock : IResource
{
public string GetResourceValue(string key)
{
return string.Empty;
}
}
}

View File

@@ -0,0 +1,18 @@
using System;
using ModernKeePass.Interfaces;
namespace ModernKeePassApp.Test.Mock
{
public class SettingsServiceMock : ISettings
{
public T GetSetting<T>(string property)
{
return default(T);
}
public void PutSetting<T>(string property, T value)
{
throw new NotImplementedException();
}
}
}